|
@@ -23,8 +23,10 @@ import org.jeecg.modules.medical.entity.MedicalDoctorAppealRecord;
|
|
import org.jeecg.modules.medical.entity.PrescriptionOrder;
|
|
import org.jeecg.modules.medical.entity.PrescriptionOrder;
|
|
import org.jeecg.modules.medical.mapper.AfterwardsAuditMapper;
|
|
import org.jeecg.modules.medical.mapper.AfterwardsAuditMapper;
|
|
import org.jeecg.modules.medical.ruleengine.projectcache.HisMedicalProjectCache;
|
|
import org.jeecg.modules.medical.ruleengine.projectcache.HisMedicalProjectCache;
|
|
|
|
+import org.jeecg.modules.medical.service.IAfterwardsAuditDetailService;
|
|
import org.jeecg.modules.medical.service.IAfterwardsAuditService;
|
|
import org.jeecg.modules.medical.service.IAfterwardsAuditService;
|
|
import org.jeecg.modules.medical.service.IMedicalDoctorAppealRecordService;
|
|
import org.jeecg.modules.medical.service.IMedicalDoctorAppealRecordService;
|
|
|
|
+import org.jeecg.modules.medical.service.IPrescriptionOrderService;
|
|
import org.jeecg.modules.system.entity.SysDepart;
|
|
import org.jeecg.modules.system.entity.SysDepart;
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
import org.jeecg.modules.system.entity.SysUserDepart;
|
|
import org.jeecg.modules.system.entity.SysUserDepart;
|
|
@@ -33,6 +35,7 @@ import org.jeecg.modules.system.service.ISysDepartService;
|
|
import org.jeecg.modules.system.service.ISysUserDepartService;
|
|
import org.jeecg.modules.system.service.ISysUserDepartService;
|
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -51,7 +54,7 @@ import java.util.stream.Collectors;
|
|
/**
|
|
/**
|
|
* @Description: afterwards_audit
|
|
* @Description: afterwards_audit
|
|
* @Author: jeecg-boot
|
|
* @Author: jeecg-boot
|
|
- * @Date: 2023-05-09 14:37:31
|
|
|
|
|
|
+ * @Date: 2023-05-09 14:37:31
|
|
* @Version: V1.0
|
|
* @Version: V1.0
|
|
*/
|
|
*/
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -59,12 +62,17 @@ import java.util.stream.Collectors;
|
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
|
public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMapper, AfterwardsAudit> implements IAfterwardsAuditService {
|
|
public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMapper, AfterwardsAudit> implements IAfterwardsAuditService {
|
|
|
|
|
|
- /** 科室/医生复核服务 */
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 科室/医生复核服务
|
|
|
|
+ */
|
|
private final IMedicalDoctorAppealRecordService appealRecordService;
|
|
private final IMedicalDoctorAppealRecordService appealRecordService;
|
|
private final ISysUserService sysUserService;
|
|
private final ISysUserService sysUserService;
|
|
private final ISysUserDepartService sysUserDepartService;
|
|
private final ISysUserDepartService sysUserDepartService;
|
|
private final ISysDepartService departService;
|
|
private final ISysDepartService departService;
|
|
|
|
|
|
|
|
+ private final IAfterwardsAuditDetailService afterwardsAuditDetailService;
|
|
|
|
+ private final IPrescriptionOrderService prescriptionOrderService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public IPage<ReportAfterQueryResponseBO> departmentStatistics(Page<AfterwardsAudit> page, AfterwardsAudit afterwardsAudit) {
|
|
public IPage<ReportAfterQueryResponseBO> departmentStatistics(Page<AfterwardsAudit> page, AfterwardsAudit afterwardsAudit) {
|
|
return baseMapper.departmentStatistics(page, afterwardsAudit);
|
|
return baseMapper.departmentStatistics(page, afterwardsAudit);
|
|
@@ -118,7 +126,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
a.setCheckState(AfterwardsAuditStatusEnum.wait.getStatus());
|
|
a.setCheckState(AfterwardsAuditStatusEnum.wait.getStatus());
|
|
}
|
|
}
|
|
// 检查当前状态 、、兼容空
|
|
// 检查当前状态 、、兼容空
|
|
- if (!ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.wait.getStatus() , a.getCheckState())
|
|
|
|
|
|
+ if (!ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.wait.getStatus(), a.getCheckState())
|
|
&& !ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.process.getStatus(), a.getCheckState())) {
|
|
&& !ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.process.getStatus(), a.getCheckState())) {
|
|
log.error("必须为待审核或医生符合后的重新审核状态才可以发起审核,当前数据状态为{}", a.getCheckState());
|
|
log.error("必须为待审核或医生符合后的重新审核状态才可以发起审核,当前数据状态为{}", a.getCheckState());
|
|
throw new JeecgBootException("当前状态不可发起审核,请检查");
|
|
throw new JeecgBootException("当前状态不可发起审核,请检查");
|
|
@@ -180,14 +188,13 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public DeptAuditResponse deptAuditPanel(String loginUserName, String doctorName) {
|
|
public DeptAuditResponse deptAuditPanel(String loginUserName, String doctorName) {
|
|
// 根据当前登录,先获取到医生面板
|
|
// 根据当前登录,先获取到医生面板
|
|
SysDepart sysDepart = new SysDepart();
|
|
SysDepart sysDepart = new SysDepart();
|
|
- if(loginUserName.equals("admin")){
|
|
|
|
|
|
+ if (loginUserName.equals("admin")) {
|
|
sysDepart = new SysDepart();
|
|
sysDepart = new SysDepart();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
sysDepart = baseMapper.loadUserDept(loginUserName);
|
|
sysDepart = baseMapper.loadUserDept(loginUserName);
|
|
if (null == sysDepart) {
|
|
if (null == sysDepart) {
|
|
log.error("找不到当前医生的科室,请检查");
|
|
log.error("找不到当前医生的科室,请检查");
|
|
@@ -215,7 +222,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public IPage<DeptAuditItemResponse> violationDoctor(Page<DeptAuditItemResponse> page,String deptCode,String createTimeBegin,String createTimeEnd) {
|
|
|
|
|
|
+ public IPage<DeptAuditItemResponse> violationDoctor(Page<DeptAuditItemResponse> page, String deptCode, String createTimeBegin, String createTimeEnd) {
|
|
|
|
|
|
// 获取违规医生列表
|
|
// 获取违规医生列表
|
|
List<DeptAuditItemResponse> deptDoctorViolationList = baseMapper.loadDeptDoctorViolationList(deptCode, null);
|
|
List<DeptAuditItemResponse> deptDoctorViolationList = baseMapper.loadDeptDoctorViolationList(deptCode, null);
|
|
@@ -263,7 +270,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
throw new JeecgBootException("审核流转状态不是处理中,请检查!");
|
|
throw new JeecgBootException("审核流转状态不是处理中,请检查!");
|
|
}
|
|
}
|
|
// 审核状态为处理中 && 处理中的状态为 待科室审核时,才继续
|
|
// 审核状态为处理中 && 处理中的状态为 待科室审核时,才继续
|
|
- if (!ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.issue_review.getStatus() ,audit.getReviewResults())) {
|
|
|
|
|
|
+ if (!ObjectUtils.nullSafeEquals(AfterwardsAuditStatusEnum.issue_review.getStatus(), audit.getReviewResults())) {
|
|
log.error("当前申诉工单id={}, 审查结果={},非下发复核状态,请检查!", param.getId(), audit.getStatus());
|
|
log.error("当前申诉工单id={}, 审查结果={},非下发复核状态,请检查!", param.getId(), audit.getStatus());
|
|
throw new JeecgBootException("审查结果非下发复核状态,请检查!");
|
|
throw new JeecgBootException("审查结果非下发复核状态,请检查!");
|
|
}
|
|
}
|
|
@@ -338,6 +345,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据id获取 事后工单
|
|
* 根据id获取 事后工单
|
|
|
|
+ *
|
|
* @param id
|
|
* @param id
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -402,6 +410,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据工单号,获取诊断信息
|
|
* 根据工单号,获取诊断信息
|
|
|
|
+ *
|
|
* @param id
|
|
* @param id
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -413,31 +422,26 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<PrescriptionOrder> loadMedicalOrderInfo(Integer id) {
|
|
public List<PrescriptionOrder> loadMedicalOrderInfo(Integer id) {
|
|
- List<PrescriptionOrder> medicalOrderInfoResponses = baseMapper.loadMedicalOrderInfo(id);
|
|
|
|
-
|
|
|
|
- for (PrescriptionOrder medicalOrderInfoRespons : medicalOrderInfoResponses) {
|
|
|
|
- String itemId = medicalOrderInfoRespons.getItemId();
|
|
|
|
- if (StringUtils.hasText(itemId)) {
|
|
|
|
-// String medicalInsuranceNumber = hisMedicalProjectCache.loadHisMedicalMapping(itemId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- return medicalOrderInfoResponses;
|
|
|
|
|
|
+ AfterwardsAudit audit = this.getById(id);
|
|
|
|
+ LambdaQueryWrapper<PrescriptionOrder> queryWrapper = Wrappers.<PrescriptionOrder>lambdaQuery()
|
|
|
|
+ .eq(PrescriptionOrder::getInpOutpatientNumber, audit.getOutpatientNumber());
|
|
|
|
+ return prescriptionOrderService.list(queryWrapper);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取医生对应的违规列表
|
|
* 获取医生对应的违规列表
|
|
|
|
+ *
|
|
* @param page
|
|
* @param page
|
|
* @param queryWrapper
|
|
* @param queryWrapper
|
|
* @param loginUser
|
|
* @param loginUser
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public IPage<AfterwardsAudit> getDoctorViolations(Page<AfterwardsAudit> page, QueryWrapper<AfterwardsAudit> queryWrapper, LoginUser loginUser,String doctorId) {
|
|
|
|
|
|
+ public IPage<AfterwardsAudit> getDoctorViolations(Page<AfterwardsAudit> page, QueryWrapper<AfterwardsAudit> queryWrapper, LoginUser loginUser, String doctorId) {
|
|
// 根据当前登录,先获取到医生面板
|
|
// 根据当前登录,先获取到医生面板
|
|
- SysUser user = sysUserService.lambdaQuery().eq(SysUser::getDoctorId,doctorId).one();
|
|
|
|
|
|
+ SysUser user = sysUserService.lambdaQuery().eq(SysUser::getDoctorId, doctorId).one();
|
|
List<SysUserDepart> list = sysUserDepartService.lambdaQuery().eq(SysUserDepart::getUserId, user.getId()).list();
|
|
List<SysUserDepart> list = sysUserDepartService.lambdaQuery().eq(SysUserDepart::getUserId, user.getId()).list();
|
|
- if (list.size()==0) {
|
|
|
|
|
|
+ if (list.size() == 0) {
|
|
log.error("找不到当前医生的科室,请检查");
|
|
log.error("找不到当前医生的科室,请检查");
|
|
throw new JeecgBootException("找不到当前医生的科室,请检查!");
|
|
throw new JeecgBootException("找不到当前医生的科室,请检查!");
|
|
}
|
|
}
|
|
@@ -455,19 +459,19 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
List<AfterwardsAudit> records = violations.getRecords();
|
|
List<AfterwardsAudit> records = violations.getRecords();
|
|
records = records.stream().map(item -> {
|
|
records = records.stream().map(item -> {
|
|
// 计算异常多收-少收
|
|
// 计算异常多收-少收
|
|
- BigDecimal detailTotalAmt = baseMapper.statisticsErrAmtByAfterwareRecordId(item.getId());
|
|
|
|
- item.setErrorRelativelyFewAmt(new BigDecimal("0.00"));
|
|
|
|
- item.setErrorRelativelyManyAmt(new BigDecimal("0.00"));
|
|
|
|
|
|
+// BigDecimal detailTotalAmt = baseMapper.statisticsErrAmtByAfterwareRecordId(item.getId());
|
|
|
|
+// item.setErrorRelativelyFewAmt(new BigDecimal("0.00"));
|
|
|
|
+// item.setErrorRelativelyManyAmt(new BigDecimal("0.00"));
|
|
if (!StringUtils.hasText(item.getCheckState())) {
|
|
if (!StringUtils.hasText(item.getCheckState())) {
|
|
item.setCheckState(AfterwardsAuditStatusEnum.wait.getStatus());
|
|
item.setCheckState(AfterwardsAuditStatusEnum.wait.getStatus());
|
|
}
|
|
}
|
|
- if (null != detailTotalAmt) {
|
|
|
|
- if (detailTotalAmt.compareTo(BigDecimal.ZERO) > 0) { // 异常金额大于0,就是多收
|
|
|
|
- item.setErrorRelativelyManyAmt(detailTotalAmt);
|
|
|
|
- } else if (detailTotalAmt.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
- item.setErrorRelativelyFewAmt(detailTotalAmt);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// if (null != detailTotalAmt) {
|
|
|
|
+// if (detailTotalAmt.compareTo(BigDecimal.ZERO) > 0) { // 异常金额大于0,就是多收
|
|
|
|
+// item.setErrorRelativelyManyAmt(detailTotalAmt);
|
|
|
|
+// } else if (detailTotalAmt.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
+// item.setErrorRelativelyFewAmt(detailTotalAmt);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
// 赋值申诉次数
|
|
// 赋值申诉次数
|
|
int appealNumber = 0;
|
|
int appealNumber = 0;
|
|
MedicalDoctorAppealRecord appealRecord = appealRecordService.loadMaxAppealNumber(item.getId(), item.getMedicalDeptCode(), item.getDoctorId());
|
|
MedicalDoctorAppealRecord appealRecord = appealRecordService.loadMaxAppealNumber(item.getId(), item.getMedicalDeptCode(), item.getDoctorId());
|
|
@@ -486,9 +490,9 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
public InpatientSettlementDetailResponse loadInpatientSettlementDetail(Integer id) {
|
|
public InpatientSettlementDetailResponse loadInpatientSettlementDetail(Integer id) {
|
|
// 获取患者信息
|
|
// 获取患者信息
|
|
PatientInfoResponse patientInfo = baseMapper.loadInpatientSettlementInfo(id);
|
|
PatientInfoResponse patientInfo = baseMapper.loadInpatientSettlementInfo(id);
|
|
- String patientId = patientInfo.getPersonalCode();
|
|
|
|
|
|
+ String hisid = patientInfo.getSettlementBillNumber();
|
|
// 获取医保项目明细
|
|
// 获取医保项目明细
|
|
- List<MedicalInsuranceProjectDetailsResponse> medicalInsuranceProjects = baseMapper.loadMedicalInsuranceProjectDetails(patientId);
|
|
|
|
|
|
+ List<MedicalInsuranceProjectDetailsResponse> medicalInsuranceProjects = baseMapper.loadMedicalInsuranceProjectDetails(hisid);
|
|
InpatientSettlementDetailResponse r = new InpatientSettlementDetailResponse();
|
|
InpatientSettlementDetailResponse r = new InpatientSettlementDetailResponse();
|
|
r.setPatientInfo(patientInfo);
|
|
r.setPatientInfo(patientInfo);
|
|
r.setHospitalizationSettleDetailResponse(medicalInsuranceProjects);
|
|
r.setHospitalizationSettleDetailResponse(medicalInsuranceProjects);
|
|
@@ -510,6 +514,7 @@ public class AfterwardsAuditServiceImpl extends ServiceImpl<AfterwardsAuditMappe
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据事后审核工单id,查询住院结算主单
|
|
* 根据事后审核工单id,查询住院结算主单
|
|
|
|
+ *
|
|
* @param id 事后审核工单id
|
|
* @param id 事后审核工单id
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|