Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dafa5961c4 | ||
|
|
f223192ec5 | ||
|
|
c7956a116b | ||
|
|
845354e863 | ||
|
|
56ea4b6af1 | ||
|
|
703e9ead43 | ||
|
|
a43f98cc5a | ||
|
|
9215c288d3 | ||
|
|
777ba71c7d | ||
|
|
c3dfd3eb21 | ||
|
|
8093f8acda | ||
|
|
8fae6fe3d5 | ||
|
|
5af86494dd |
@@ -51,4 +51,20 @@ public interface IRequestFormManageAppService {
|
|||||||
* @return 申请单
|
* @return 申请单
|
||||||
*/
|
*/
|
||||||
IPage<RequestFormPageDto> getRequestFormPage(RequestFormDto requestFormDto);
|
IPage<RequestFormPageDto> getRequestFormPage(RequestFormDto requestFormDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申请单(仅待签发状态可删除)
|
||||||
|
*
|
||||||
|
* @param requestFormId 申请单ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> deleteRequestForm(Long requestFormId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回申请单(已签发状态撤回至待签发)
|
||||||
|
*
|
||||||
|
* @param requestFormId 申请单ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
R<?> withdrawRequestForm(Long requestFormId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -456,4 +456,68 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
return requestFormManageAppMapper.getRequestFormPage(requestFormDto, page);
|
return requestFormManageAppMapper.getRequestFormPage(requestFormDto, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申请单(仅待签发状态可删除)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public R<?> deleteRequestForm(Long requestFormId) {
|
||||||
|
if (requestFormId == null) {
|
||||||
|
return R.fail("申请单ID不能为空");
|
||||||
|
}
|
||||||
|
RequestForm requestForm = iRequestFormService.getById(requestFormId);
|
||||||
|
if (requestForm == null) {
|
||||||
|
return R.fail("申请单不存在");
|
||||||
|
}
|
||||||
|
if (!Integer.valueOf(0).equals(requestForm.getStatus())) {
|
||||||
|
return R.fail("仅待签发状态的申请单可删除");
|
||||||
|
}
|
||||||
|
// 删除申请单
|
||||||
|
iRequestFormService.removeById(requestFormId);
|
||||||
|
// 删除关联的诊疗项目及账单
|
||||||
|
String prescriptionNo = requestForm.getPrescriptionNo();
|
||||||
|
List<Long> serviceRequestIds = iServiceRequestService
|
||||||
|
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getPrescriptionNo, prescriptionNo))
|
||||||
|
.stream().map(ServiceRequest::getId).collect(Collectors.toList());
|
||||||
|
for (Long serviceRequestId : serviceRequestIds) {
|
||||||
|
iServiceRequestService.removeById(serviceRequestId);
|
||||||
|
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_SERVICE_REQUEST, serviceRequestId);
|
||||||
|
}
|
||||||
|
return R.ok(null, "删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回申请单(已签发状态撤回至待签发)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public R<?> withdrawRequestForm(Long requestFormId) {
|
||||||
|
if (requestFormId == null) {
|
||||||
|
return R.fail("申请单ID不能为空");
|
||||||
|
}
|
||||||
|
RequestForm requestForm = iRequestFormService.getById(requestFormId);
|
||||||
|
if (requestForm == null) {
|
||||||
|
return R.fail("申请单不存在");
|
||||||
|
}
|
||||||
|
if (!Integer.valueOf(1).equals(requestForm.getStatus())) {
|
||||||
|
return R.fail("仅已签发状态的申请单可撤回");
|
||||||
|
}
|
||||||
|
// 将申请单状态回滚至待签发
|
||||||
|
RequestForm updateForm = new RequestForm();
|
||||||
|
updateForm.setId(requestFormId);
|
||||||
|
updateForm.setStatus(0);
|
||||||
|
iRequestFormService.updateById(updateForm);
|
||||||
|
// 将关联的诊疗项目状态回滚至DRAFT
|
||||||
|
String prescriptionNo = requestForm.getPrescriptionNo();
|
||||||
|
List<ServiceRequest> serviceRequests = iServiceRequestService
|
||||||
|
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getPrescriptionNo, prescriptionNo));
|
||||||
|
for (ServiceRequest serviceRequest : serviceRequests) {
|
||||||
|
ServiceRequest updateService = new ServiceRequest();
|
||||||
|
updateService.setId(serviceRequest.getId());
|
||||||
|
updateService.setStatusEnum(RequestStatus.DRAFT.getValue());
|
||||||
|
iServiceRequestService.updateById(updateService);
|
||||||
|
}
|
||||||
|
return R.ok(null, "撤回成功");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ public class RequestFormManageController {
|
|||||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||||
* @param status 单据状态(可选)
|
* @param status 单据状态(可选)
|
||||||
|
* @param keyword 关键字(可选,申请单号/检验项目名称模糊匹配)
|
||||||
* @return 检验申请单
|
* @return 检验申请单
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/get-inspection")
|
@GetMapping(value = "/get-inspection")
|
||||||
@@ -105,11 +106,12 @@ public class RequestFormManageController {
|
|||||||
@RequestParam(required = false) Long encounterId,
|
@RequestParam(required = false) Long encounterId,
|
||||||
@RequestParam(required = false) String startDate,
|
@RequestParam(required = false) String startDate,
|
||||||
@RequestParam(required = false) String endDate,
|
@RequestParam(required = false) String endDate,
|
||||||
@RequestParam(required = false) String status) {
|
@RequestParam(required = false) String status,
|
||||||
|
@RequestParam(required = false) String keyword) {
|
||||||
if (encounterId == null) {
|
if (encounterId == null) {
|
||||||
return R.fail("就诊ID不能为空");
|
return R.fail("就诊ID不能为空");
|
||||||
}
|
}
|
||||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode(), startDate, endDate, status));
|
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode(), startDate, endDate, status, keyword));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -280,9 +280,17 @@
|
|||||||
aa.balance_amount
|
aa.balance_amount
|
||||||
) AS personal_account
|
) AS personal_account
|
||||||
ON personal_account.encounter_id = ae.id
|
ON personal_account.encounter_id = ae.id
|
||||||
LEFT JOIN med_medication_dispense mmd
|
LEFT JOIN (
|
||||||
|
SELECT med_req_id, status_enum
|
||||||
|
FROM (
|
||||||
|
SELECT med_req_id, status_enum,
|
||||||
|
ROW_NUMBER() OVER (PARTITION BY med_req_id ORDER BY id DESC) AS rn
|
||||||
|
FROM med_medication_dispense
|
||||||
|
WHERE delete_flag = '0'
|
||||||
|
) t
|
||||||
|
WHERE rn = 1
|
||||||
|
) mmd
|
||||||
ON mmd.med_req_id = T1.id
|
ON mmd.med_req_id = T1.id
|
||||||
AND mmd.delete_flag = '0'
|
|
||||||
WHERE T1.delete_flag = '0'
|
WHERE T1.delete_flag = '0'
|
||||||
AND T1.refund_medicine_id IS NULL
|
AND T1.refund_medicine_id IS NULL
|
||||||
AND T1.generate_source_enum = #{doctorPrescription}
|
AND T1.generate_source_enum = #{doctorPrescription}
|
||||||
|
|||||||
@@ -59,4 +59,9 @@ public class RequestForm extends HisBaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String typeCode;
|
private String typeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据状态 0=待签发 1=已签发 2=已校对 3=待接收 4=已接收 5=已检查 6=已出报告 7=已作废
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -802,10 +802,8 @@ function clickRowDb(row, column, event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
row.showPopover = false;
|
row.showPopover = false;
|
||||||
// 允许所有 statusEnum==1 的医嘱进入编辑:
|
// “待签发(已保存 requestId存在)”不允许再编辑;仅“待保存(无requestId)”允许编辑
|
||||||
// 1. 新医嘱(无 requestId):待保存
|
if (row.statusEnum == 1 && !row.requestId) {
|
||||||
// 2. 护士退回医嘱(有 requestId):退回后状态重置为 DRAFT(1),需允许医生编辑修改后重新签发
|
|
||||||
if (row.statusEnum == 1) {
|
|
||||||
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
||||||
row.therapyEnum = String(row.therapyEnum ?? '1');
|
row.therapyEnum = String(row.therapyEnum ?? '1');
|
||||||
row.isEdit = true;
|
row.isEdit = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user