后端最新版本同步
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.openhis.web.jlau.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto;
|
||||
|
||||
/**
|
||||
* 农大审方记录 应用Service
|
||||
*/
|
||||
public interface IReviewPrescriptionRecordsAppService {
|
||||
|
||||
/**
|
||||
* 审核处方
|
||||
*
|
||||
* @param reviewPrescriptionRecordsDto 审方记录dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> reviewPrescription(ReviewPrescriptionRecordsDto reviewPrescriptionRecordsDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.openhis.web.jlau.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
import com.openhis.jlau.domain.ReviewPrescriptionRecords;
|
||||
import com.openhis.jlau.service.IReviewPrescriptionRecordsService;
|
||||
import com.openhis.web.jlau.appservice.IReviewPrescriptionRecordsAppService;
|
||||
import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto;
|
||||
import com.openhis.web.jlau.mapper.ReviewPrescriptionRecordsAppMapper;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 农大审方记录 应用实现类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ReviewPrescriptionRecordsAppServiceImpl implements IReviewPrescriptionRecordsAppService {
|
||||
|
||||
@Resource
|
||||
ReviewPrescriptionRecordsAppMapper reviewPrescriptionRecordsAppMapper;
|
||||
|
||||
@Resource
|
||||
IChargeItemService chargeItemService;
|
||||
|
||||
@Resource
|
||||
IReviewPrescriptionRecordsService reviewPrescriptionRecordsService;
|
||||
|
||||
/**
|
||||
* 审核处方
|
||||
*
|
||||
* @param reviewPrescriptionRecordsDto 审方记录dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> reviewPrescription(ReviewPrescriptionRecordsDto reviewPrescriptionRecordsDto) {
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 就诊id
|
||||
Long encounterId = reviewPrescriptionRecordsDto.getEncounterId();
|
||||
// 处方号
|
||||
String prescriptionNo = reviewPrescriptionRecordsDto.getPrescriptionNo();
|
||||
// 药品请求ids
|
||||
String medRequestIds = reviewPrescriptionRecordsDto.getMedRequestIds();
|
||||
if (StringUtils.isNotEmpty(medRequestIds)) {
|
||||
List<Long> medRequestIdList = Arrays.stream(medRequestIds.split(",")).map(String::trim) // 去除空格
|
||||
.map(Long::valueOf) // 转换为Long
|
||||
.collect(Collectors.toList());
|
||||
if (!medRequestIdList.isEmpty()) {
|
||||
List<ChargeItem> list = chargeItemService.list(new LambdaQueryWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getStatusEnum, ChargeItemStatus.BILLED.getValue())
|
||||
.in(ChargeItem::getServiceId, medRequestIdList));
|
||||
if (!list.isEmpty()) {
|
||||
throw new ServiceException("已收费药品,无需审核");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 审方id
|
||||
Long reviewId = reviewPrescriptionRecordsDto.getReviewId();
|
||||
// 通过标识
|
||||
Integer passFlag = reviewPrescriptionRecordsDto.getPassFlag();
|
||||
// 原因
|
||||
String reasonText = reviewPrescriptionRecordsDto.getReasonText();
|
||||
// 保存审核记录
|
||||
ReviewPrescriptionRecords reviewPrescriptionRecords;
|
||||
reviewPrescriptionRecords = new ReviewPrescriptionRecords();
|
||||
reviewPrescriptionRecords.setId(reviewId); // id
|
||||
reviewPrescriptionRecords.setEncounterId(encounterId); // 就诊id
|
||||
reviewPrescriptionRecords.setPrescriptionNo(prescriptionNo); // 处方号
|
||||
reviewPrescriptionRecords.setMedRequestIds(medRequestIds); // 药品请求ids
|
||||
reviewPrescriptionRecords.setPassFlag(passFlag); // 通过标识
|
||||
reviewPrescriptionRecords.setReasonText(reasonText); // 原因
|
||||
reviewPrescriptionRecords.setPractitionerId(practitionerId); // 审方人id
|
||||
reviewPrescriptionRecordsService.saveOrUpdate(reviewPrescriptionRecords);
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"审核处方"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.jlau.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto;
|
||||
import com.openhis.web.regdoctorstation.dto.NursingOrdersSaveDto;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.openhis.web.jlau.appservice.IReviewPrescriptionRecordsAppService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 农大审方记录 controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jlau/review-prescription-records")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class ReviewPrescriptionRecordsController {
|
||||
|
||||
private final IReviewPrescriptionRecordsAppService iReviewPrescriptionRecordsAppService;
|
||||
|
||||
/**
|
||||
* 审核处方
|
||||
*
|
||||
* @param reviewPrescriptionRecordsDto 审方记录dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/review-prescription")
|
||||
public R<?> reviewPrescription(@RequestBody ReviewPrescriptionRecordsDto reviewPrescriptionRecordsDto) {
|
||||
return iReviewPrescriptionRecordsAppService.reviewPrescription(reviewPrescriptionRecordsDto);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.openhis.web.jlau.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 农大审方记录 dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ReviewPrescriptionRecordsDto {
|
||||
|
||||
/**
|
||||
* 就诊id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/**
|
||||
* 处方号
|
||||
*/
|
||||
private String prescriptionNo;
|
||||
|
||||
/**
|
||||
* 药品请求ids
|
||||
*/
|
||||
private String medRequestIds;
|
||||
|
||||
/**
|
||||
* 审方id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long reviewId;
|
||||
|
||||
/**
|
||||
* 通过标识
|
||||
*/
|
||||
private Integer passFlag;
|
||||
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
private String reasonText;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.openhis.web.jlau.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 农大审方记录 应用Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface ReviewPrescriptionRecordsAppMapper {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user