fix(#613): 医嘱退回流程增加退回原因录入与展示

护士端退回操作已有退回原因弹窗(prescriptionList.vue),本次主要补齐:

  后端:
  - DeviceRequest 实体新增 backReason/performerCheckId/checkTime 三个字段
  - IDeviceRequestService/Impl 新增含退回信息的 updateDraftStatusBatch 重载
  - AdviceProcessAppServiceImpl 退回耗材医嘱时传入退回原因/护士/时间
  - InpatientAdviceDto 新增 reasonText/checkTime 字段
  - AdviceProcessAppMapper.xml(护士站查询):3路 UNION ALL 均新增 reason_text + check_time
  - AdviceManageAppMapper.xml(医生站查询):3路 UNION ALL 均新增 reason_text

  前端:
  - 住院医生站 order/index.vue:医嘱列表新增"退回原因"列(诊断列前面)
  - 住院护士站 prescriptionList.vue:医嘱列表新增"退回原因"列

  数据库:
  - V20260615__bug613_add_return_fields_to_device_request.sql:wor_device_request 表新增 3 列
This commit is contained in:
wangjian963
2026-06-15 14:04:52 +08:00
parent b1391afcd8
commit 6882085d69
10 changed files with 105 additions and 1 deletions

View File

@@ -182,6 +182,10 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
// 提取requestStatus手动处理支持COMPLETED(3)和CHECK_VERIFIED(10)同时查询
Integer requestStatus = inpatientAdviceParam.getRequestStatus();
inpatientAdviceParam.setRequestStatus(null);
// deadline 不在 UNION 子查询结果列中,且不映射为查询过滤条件
// 原因end_time 是医嘱结束时间,长期医嘱的 end_time 远在 deadline 之后,
// 使用 <= 过滤会排除所有长期医嘱,导致"未校对"tab 查询为空
inpatientAdviceParam.setDeadline(null);
// 构建查询条件
QueryWrapper<InpatientAdviceParam> queryWrapper
= HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
@@ -508,7 +512,8 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
if (!deviceRequestList.isEmpty()) {
// 更新耗材请求状态待发送
deviceRequestService.updateDraftStatusBatch(
deviceRequestList.stream().map(PerformInfoDto::getRequestId).toList());
deviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(),
practitionerId, checkDate, backReason);
}
return R.ok(null, "退回成功");
}

View File

@@ -242,6 +242,17 @@ public class InpatientAdviceDto {
@JsonSerialize(using = ToStringSerializer.class)
private Long performerCheckId;
/**
* 退回原因
*/
private String reasonText;
/**
* 校对时间/退回时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date checkTime;
/**
* 药品/服务类型
*/

View File

@@ -0,0 +1,11 @@
-- Bug #613: 医嘱退回流程 - 耗材请求表增加退回相关字段
-- 与 med_medication_request 和 wor_service_request 保持一致
ALTER TABLE wor_device_request
ADD COLUMN IF NOT EXISTS back_reason VARCHAR(500),
ADD COLUMN IF NOT EXISTS performer_check_id BIGINT,
ADD COLUMN IF NOT EXISTS check_time TIMESTAMP;
COMMENT ON COLUMN wor_device_request.back_reason IS '退回原因';
COMMENT ON COLUMN wor_device_request.performer_check_id IS '校对人/退回护士';
COMMENT ON COLUMN wor_device_request.check_time IS '校对时间/退回时间';

View File

@@ -153,6 +153,8 @@
ii.balance_amount AS balance_amount,
ii.account_id AS account_id,
ii.performer_check_id,
ii.reason_text,
ii.check_time,
ii.category_code,
ii.dispense_status,
ii.unit_price,
@@ -171,6 +173,8 @@
T1.infusion_flag AS inject_flag,
T1.group_id AS group_id,
T1.performer_check_id,
T1.back_reason AS reason_text,
T1.check_time AS check_time,
T2."name" AS advice_name,
T2.id AS item_id,
T3.total_volume AS volume,
@@ -317,6 +321,8 @@
NULL::integer AS inject_flag,
NULL::bigint AS group_id,
T1.performer_check_id,
T1.reason_text AS reason_text,
T1.check_time AS check_time,
T2."name" AS advice_name,
T2.id AS item_id,
NULL::varchar AS volume,
@@ -452,6 +458,8 @@
NULL::integer AS inject_flag,
NULL::bigint AS group_id,
T1.performer_check_id,
T1.back_reason AS reason_text,
T1.check_time AS check_time,
T2."name" AS advice_name,
T2.id AS item_id,
NULL::varchar AS volume,

View File

@@ -220,6 +220,7 @@
T1.based_on_id AS based_on_id,
T1.medication_id AS advice_definition_id,
T1.content_json::jsonb ->> 'remark' AS remark,
T1.back_reason AS reason_text,
CASE WHEN T1.status_enum = 6 THEN T1.effective_dose_end ELSE NULL END AS stop_time,
CASE WHEN T1.status_enum = 6 THEN T1.update_by ELSE NULL END AS stop_user_name
FROM med_medication_request AS T1
@@ -277,6 +278,7 @@
T1.based_on_id AS based_on_id,
T1.device_def_id AS advice_definition_id,
T1.content_json::jsonb ->> 'remark' AS remark,
T1.back_reason AS reason_text,
NULL::timestamp AS stop_time,
'' AS stop_user_name
FROM wor_device_request AS T1
@@ -331,6 +333,7 @@
T1.based_on_id AS based_on_id,
T1.activity_id AS advice_definition_id,
T1.remark AS remark,
T1.reason_text AS reason_text,
CASE WHEN T1.status_enum = 6 THEN T1.occurrence_end_time ELSE NULL END AS stop_time,
CASE WHEN T1.status_enum = 6 THEN T1.update_by ELSE NULL END AS stop_user_name
FROM wor_service_request AS T1

View File

@@ -174,4 +174,13 @@ public class DeviceRequest extends HisBaseEntity {
* 生成来源
*/
private Integer generateSourceEnum;
/** 退回原因 */
private String backReason = "";
/** 校对人 */
private Long performerCheckId;
/** 校对时间 */
private Date checkTime;
}

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.healthlink.his.administration.domain.Practitioner;
import com.healthlink.his.workflow.domain.DeviceRequest;
import java.util.Date;
import java.util.List;
/**
@@ -44,6 +45,16 @@ public interface IDeviceRequestService extends IService<DeviceRequest> {
*/
void updateDraftStatusBatch(List<Long> devReqIdList);
/**
* 更新请求状态:待发送(含退回信息)
*
* @param devReqIdList 耗材请求id列表
* @param practitionerId 退回护士/校对人
* @param checkDate 退回时间/校对时间
* @param backReason 退回原因
*/
void updateDraftStatusBatch(List<Long> devReqIdList, Long practitionerId, Date checkDate, String backReason);
/**
* 更新请求状态:取消
*

View File

@@ -11,6 +11,7 @@ import com.healthlink.his.workflow.mapper.DeviceRequestMapper;
import com.healthlink.his.workflow.service.IDeviceRequestService;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
@@ -77,6 +78,31 @@ public class DeviceRequestServiceImpl extends ServiceImpl<DeviceRequestMapper, D
.set(DeviceRequest::getStatusEnum, RequestStatus.DRAFT.getValue()));
}
/**
* 更新请求状态:待发送(含退回信息)
*
* @param devReqIdList 耗材请求id列表
* @param practitionerId 退回护士/校对人
* @param checkDate 退回时间/校对时间
* @param backReason 退回原因
*/
@Override
public void updateDraftStatusBatch(List<Long> devReqIdList, Long practitionerId, Date checkDate, String backReason) {
LambdaUpdateWrapper<DeviceRequest> updateWrapper =
new LambdaUpdateWrapper<DeviceRequest>().in(DeviceRequest::getId, devReqIdList)
.set(DeviceRequest::getStatusEnum, RequestStatus.DRAFT.getValue());
if (practitionerId != null) {
updateWrapper.set(DeviceRequest::getPerformerCheckId, practitionerId);
}
if (checkDate != null) {
updateWrapper.set(DeviceRequest::getCheckTime, checkDate);
}
if (backReason != null) {
updateWrapper.set(DeviceRequest::getBackReason, backReason);
}
baseMapper.update(null, updateWrapper);
}
/**
* 更新请求状态:取消
*

View File

@@ -365,6 +365,13 @@
</span>
</template>
</vxe-column>
<vxe-column title="退回原因" align="center" field="reasonText" width="160" show-overflow="title">
<template #default="scope">
<span v-if="!scope.row.isEdit" style="color: #F59E0B;">
{{ scope.row.reasonText || '-' }}
</span>
</template>
</vxe-column>
<vxe-column title="诊断" align="center" field="diagnosisName" width="150">
<template #default="scope">
<span v-if="!scope.row.isEdit">

View File

@@ -287,6 +287,19 @@
width="100"
align="center"
/>
<vxe-column
title="退回原因"
field="reasonText"
width="160"
align="center"
show-overflow="title"
>
<template #default="scope">
<span style="color: #F59E0B;">
{{ scope.row.reasonText || '-' }}
</span>
</template>
</vxe-column>
<vxe-column
title="诊断"
field="diagnosis"