|
@@ -1,27 +1,33 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
-import com.diagbot.dto.*;
|
|
|
|
-import com.diagbot.entity.*;
|
|
|
|
|
|
+import com.diagbot.dto.AlgorithmDTO;
|
|
|
|
+import com.diagbot.dto.AnalyzeDTO;
|
|
|
|
+import com.diagbot.dto.QcCasesHistoryDTO;
|
|
|
|
+import com.diagbot.dto.QcResultDTO;
|
|
|
|
+import com.diagbot.entity.BehospitalInfo;
|
|
|
|
+import com.diagbot.entity.MedQcresultCases;
|
|
|
|
+import com.diagbot.entity.QcresultDetail;
|
|
|
|
+import com.diagbot.entity.QcresultInfo;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
-import com.diagbot.facade.data.AHomePageFacade;
|
|
|
|
-import com.diagbot.facade.data.AMedAbnormalInfoFacade;
|
|
|
|
import com.diagbot.service.impl.MedQcresultCasesServiceImpl;
|
|
import com.diagbot.service.impl.MedQcresultCasesServiceImpl;
|
|
import com.diagbot.service.impl.QcresultDetailServiceImpl;
|
|
import com.diagbot.service.impl.QcresultDetailServiceImpl;
|
|
import com.diagbot.service.impl.QcresultInfoServiceImpl;
|
|
import com.diagbot.service.impl.QcresultInfoServiceImpl;
|
|
-import com.diagbot.util.*;
|
|
|
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
|
+import com.diagbot.util.DateUtil;
|
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
|
+import com.diagbot.util.SysUserUtils;
|
|
import com.diagbot.vo.*;
|
|
import com.diagbot.vo.*;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
-import java.util.Arrays;
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -40,22 +46,10 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
@Autowired
|
|
@Autowired
|
|
private BehospitalInfoFacade behospitalInfoFacade;
|
|
private BehospitalInfoFacade behospitalInfoFacade;
|
|
@Autowired
|
|
@Autowired
|
|
- private AHomePageFacade aHomePageFacade;
|
|
|
|
- @Autowired
|
|
|
|
- private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
|
|
|
|
- @Autowired
|
|
|
|
private MedCheckInfoFacade medCheckInfoFacade;
|
|
private MedCheckInfoFacade medCheckInfoFacade;
|
|
@Autowired
|
|
@Autowired
|
|
@Qualifier("medQcresultCasesServiceImpl")
|
|
@Qualifier("medQcresultCasesServiceImpl")
|
|
private MedQcresultCasesServiceImpl medQcresultCasesService;
|
|
private MedQcresultCasesServiceImpl medQcresultCasesService;
|
|
- @Autowired
|
|
|
|
- private QcCasesEntryFacade qcCasesEntryFacade;
|
|
|
|
- @Autowired
|
|
|
|
- private QcModeFacade qcModeFacade;
|
|
|
|
- @Autowired
|
|
|
|
- private SysUserFacade sysUserFacade;
|
|
|
|
-
|
|
|
|
- private TZDBConnForHis tzDBConnForHis = new TZDBConnForHis();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改评分结果信息
|
|
* 修改评分结果信息
|
|
@@ -269,67 +263,6 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
qcresultDetailAdd.setModifier(useId.toString());
|
|
qcresultDetailAdd.setModifier(useId.toString());
|
|
qcresultDetailAdd.setQcresultInfoId(newId);
|
|
qcresultDetailAdd.setQcresultInfoId(newId);
|
|
qcresultDetailServiceImpl.save(qcresultDetailAdd);
|
|
qcresultDetailServiceImpl.save(qcresultDetailAdd);
|
|
- try {
|
|
|
|
- //发送质控人员新增人工缺陷到his系统
|
|
|
|
- SentEntryRecordDTO sentEntryRecordDTO = new SentEntryRecordDTO();
|
|
|
|
- BeanUtil.copyProperties(qcresultDetailAdd, sentEntryRecordDTO);
|
|
|
|
- MedCheckInfo medCheckInfo = medCheckInfoFacade.lambdaQuery()
|
|
|
|
- .eq(MedCheckInfo::getBehospitalCode, sentEntryRecordDTO.getBehospitalCode())
|
|
|
|
- .eq(MedCheckInfo::getHospitalId, qcresultDetailAdd.getHospitalId())
|
|
|
|
- // .eq(MedCheckInfo::getStatus, 1)
|
|
|
|
- .in(MedCheckInfo::getCheckType, Arrays.asList(0, 2))
|
|
|
|
- .eq(MedCheckInfo::getIsDeleted, IsDeleteEnum.N.getKey()).one();
|
|
|
|
- if (null != medCheckInfo) {
|
|
|
|
- sentEntryRecordDTO.setCheckName(medCheckInfo.getCheckName());
|
|
|
|
- sentEntryRecordDTO.setCheckTime(medCheckInfo.getCheckTime());
|
|
|
|
-
|
|
|
|
- SysUser sysUser = sysUserFacade.lambdaQuery()
|
|
|
|
- .eq(SysUser::getId, medCheckInfo.getCheckId())
|
|
|
|
- .eq(SysUser::getStatus, 1)
|
|
|
|
- .eq(SysUser::getIsDeleted, IsDeleteEnum.N.getKey()).one();
|
|
|
|
- if (null != sysUser) {
|
|
|
|
- sentEntryRecordDTO.setCheckId(sysUser.getUsername());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- QcCasesEntry qcCasesEntry = qcCasesEntryFacade.lambdaQuery()
|
|
|
|
- .eq(QcCasesEntry::getId, qcresultDetailAdd.getCasesEntryId())
|
|
|
|
- .eq(QcCasesEntry::getIsDeleted, IsDeleteEnum.N.getKey()).one();
|
|
|
|
- if (null != qcCasesEntry) {
|
|
|
|
- QcMode qcMode = qcModeFacade.lambdaQuery()
|
|
|
|
- .eq(QcMode::getId, qcCasesEntry.getModeId())
|
|
|
|
- .eq(QcMode::getIsDeleted, IsDeleteEnum.N.getKey()).one();
|
|
|
|
- if (null != qcMode) {
|
|
|
|
- sentEntryRecordDTO.setModeName(qcMode.getName());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //获取患者的科室id
|
|
|
|
- BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
|
- .eq("behospital_code", sentEntryRecordDTO.getBehospitalCode())
|
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
|
- if (null != behospitalInfo) {
|
|
|
|
- sentEntryRecordDTO.setDeptId(behospitalInfo.getBehDeptId());
|
|
|
|
- }
|
|
|
|
- //根据his新增相应的数据
|
|
|
|
- try {
|
|
|
|
- //根据behospitalCode截取patientId和visitId
|
|
|
|
- String patientId = sentEntryRecordDTO.getBehospitalCode().split("_")[0];
|
|
|
|
- String visitId = sentEntryRecordDTO.getBehospitalCode().split("_")[1];
|
|
|
|
- //获取on_line表中的医生姓名
|
|
|
|
- String sql = "select * from doctor_hos where user_id = (select request_doctor_id from mr_on_line where patient ='" +
|
|
|
|
- patientId + "' and visit_id= '" + visitId + "' and status='0') and dept_code= '" + sentEntryRecordDTO.getDeptId() + "'";
|
|
|
|
- List<String> doctorNames = tzDBConnForHis.getdoctorName(sql);
|
|
|
|
- if (doctorNames != null && doctorNames.size() > 0) {
|
|
|
|
- sentEntryRecordDTO.setDoctorName(doctorNames.get(0));
|
|
|
|
- }
|
|
|
|
- Integer i = tzDBConnForHis.setQcMessAge(sentEntryRecordDTO);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("发送质控人员新增人工缺陷到his系统失败", "", "", JSON.toJSONString(sentEntryRecordDTO), e.getMessage());
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
//删除条目
|
|
//删除条目
|
|
@@ -340,24 +273,6 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
);
|
|
);
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
- try {
|
|
|
|
- //发送质控人员修改人工缺陷到his系统
|
|
|
|
- SentEntryRecordDTO updateEntryRecordDTO = new SentEntryRecordDTO();
|
|
|
|
- BeanUtil.copyProperties(algorithmVO.getOptResultAlgVO(), updateEntryRecordDTO);
|
|
|
|
- updateEntryRecordDTO.setBehospitalCode(analyzeVO.getBehospitalCode());
|
|
|
|
- QcresultDetail qcresultDetail = qcresultDetailServiceImpl.getOne(new QueryWrapper<QcresultDetail>()
|
|
|
|
- .eq("id", algorithmVO.getOptResultAlgVO().getId()));
|
|
|
|
- String oldMsg = qcresultDetail.getMsg();
|
|
|
|
- try {
|
|
|
|
- Integer i = tzDBConnForHis.UpdateQcMessAge(updateEntryRecordDTO, oldMsg);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("发送质控人员修改人工缺陷到his系统失败", "", "", JSON.toJSONString(updateEntryRecordDTO), e.getMessage());
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
//修改条目
|
|
//修改条目
|
|
qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
|
|
qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
|
|
.eq("id", algorithmVO.getOptResultAlgVO().getId())
|
|
.eq("id", algorithmVO.getOptResultAlgVO().getId())
|
|
@@ -375,22 +290,6 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
);
|
|
);
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
- try {
|
|
|
|
- //发送质控人员删除人工缺陷到his系统
|
|
|
|
- QcresultDetail deleteQcDetail = qcresultDetailServiceImpl.getOne(new QueryWrapper<QcresultDetail>()
|
|
|
|
- .eq("id", algorithmVO.getOptResultAlgVO().getId()));
|
|
|
|
- SentEntryRecordDTO deleteEntryRecordDTO = new SentEntryRecordDTO();
|
|
|
|
- deleteEntryRecordDTO.setMsg(deleteQcDetail.getMsg());
|
|
|
|
- deleteEntryRecordDTO.setBehospitalCode(analyzeVO.getBehospitalCode());
|
|
|
|
- try {
|
|
|
|
- Integer i = tzDBConnForHis.DeleteQcMessAge(deleteEntryRecordDTO);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("发送质控人员删除人工缺陷到his系统失败", "", "", JSON.toJSONString(deleteEntryRecordDTO), e.getMessage());
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
//获取病历核查人员id,该操作只能是核查员操作
|
|
//获取病历核查人员id,该操作只能是核查员操作
|
|
// Long checkId = medCheckInfoFacade.getOne(new QueryWrapper<MedCheckInfo>()
|
|
// Long checkId = medCheckInfoFacade.getOne(new QueryWrapper<MedCheckInfo>()
|
|
// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -518,11 +417,10 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 历史评分
|
|
* 历史评分
|
|
- *
|
|
|
|
* @param historyAnalyzePageVO
|
|
* @param historyAnalyzePageVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public IPage<QcCasesHistoryDTO> getMedQcresultResultList(HistoryAnalyzePageVO historyAnalyzePageVO) {
|
|
|
|
|
|
+ public IPage<QcCasesHistoryDTO> getMedQcresultResultList(HistoryAnalyzePageVO historyAnalyzePageVO){
|
|
return getMedQcresultResult(historyAnalyzePageVO);
|
|
return getMedQcresultResult(historyAnalyzePageVO);
|
|
}
|
|
}
|
|
}
|
|
}
|