Browse Source

把合理用药换成警告而不是错误

DESKTOP-0GD05B0\Administrator 2 năm trước cách đây
mục cha
commit
a1460251c1

+ 134 - 129
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -102,7 +102,7 @@ public class SetlListUpldService {
     public SetlListUpldService(ExecService exec, SiQueryDao queryDao, UpIdCollectionDao upIdCollectionDao,
                                DismissDao dismissDao, PublicServer publicServer, SendWxInfoService sendWxInfoService,
                                SiLogDao logDao, CaseFrontSheetMainService caseFrontSheetMainService,
-                               RedisLikeService redisLikeService,DrgWebServices drgWebServices) {
+                               RedisLikeService redisLikeService, DrgWebServices drgWebServices) {
         this.exec = exec;
         this.queryDao = queryDao;
         this.dao = upIdCollectionDao;
@@ -624,14 +624,14 @@ public class SetlListUpldService {
         if (ListUtil.isBlank(param)) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择需要上传的患者。");
         }
-        List<String> visitIds = param.stream().map(obj->obj.getPatNo()+obj.getTimes()).collect(Collectors.toList());
+        List<String> visitIds = param.stream().map(obj -> obj.getPatNo() + obj.getTimes()).collect(Collectors.toList());
         List<Integer> auditFlags = dao.listSetlModifyReq(visitIds);
-        if(ListUtil.notBlank(auditFlags)){
-            boolean flag = auditFlags.stream().allMatch(obj -> obj==1);
-            if(!flag || auditFlags.size() < param.size()){
+        if (ListUtil.notBlank(auditFlags)) {
+            boolean flag = auditFlags.stream().allMatch(obj -> obj == 1);
+            if (!flag || auditFlags.size() < param.size()) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "选中上传的患者审核状态必须要全部为审核通过。");
             }
-        }else {
+        } else {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "选中上传的患者审核状态必须要全部为审核通过。");
         }
         for (int i = 0; i < param.size(); i++) {
@@ -662,8 +662,8 @@ public class SetlListUpldService {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有要上传的信息。");
             }
             // 只有全部为审核通过的数据才能上传
-            boolean isAllAuditPass = list.stream().allMatch(obj ->obj.getAuditFlag()!=null && obj.getAuditFlag()==1);
-            if(!isAllAuditPass){
+            boolean isAllAuditPass = list.stream().allMatch(obj -> obj.getAuditFlag() != null && obj.getAuditFlag() == 1);
+            if (!isAllAuditPass) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "要所有数据为审核通过状态才能全部上传。");
             }
             upldSetlListBatch(list);
@@ -777,8 +777,8 @@ public class SetlListUpldService {
             if (null != medType) {
                 item.setMedTypeName(medType.getName());
             }
-            item.setUploadStatus(StringUtil.isBlank(item.getSetlListId())?"未上传":"已上传");
-            item.setUploadCutoffDate(getUploadCutoffDate(dictValue,item.getSetlTime(),item.getSetlListId()));
+            item.setUploadStatus(StringUtil.isBlank(item.getSetlListId()) ? "未上传" : "已上传");
+            item.setUploadCutoffDate(getUploadCutoffDate(dictValue, item.getSetlTime(), item.getSetlListId()));
             item.setInsuplcAdmdvsName(redisLikeService.getRegionName(item.getInsuplcAdmdvs()));
         }
         Map<String, ZyDisDiagYb> zhuZhenDuanOld = dao.zhuZhenDuan(inpatientNos, "zy_dis_diag_yb").stream().collect(Collectors.toMap(item -> item.getInpatientNo() + item.getAdmissTimes(), a -> a, (k1, k2) -> k1));
@@ -826,6 +826,7 @@ public class SetlListUpldService {
         }
         return ResultVoUtil.success(page);
     }
+
     /**
      * @description:获取上传截止时间
      * @author: lihong
@@ -833,17 +834,17 @@ public class SetlListUpldService {
      * @param: dictValue
      * @param: setlTime
      **/
-    private String getUploadCutoffDate(String dictValue, Date setlTime,String setlListId) {
+    private String getUploadCutoffDate(String dictValue, Date setlTime, String setlListId) {
         String result = "";
         Date now = new Date();
         int days = Integer.parseInt(dictValue);
         int diffDay = DateUtil.daysBetween(now, setlTime);
-        if(StringUtil.isBlank(setlListId)){
+        if (StringUtil.isBlank(setlListId)) {
             //未上传
-            if(diffDay < days){
-                result = "距离上传截止时间还剩"+(days-diffDay)+"天";
-            }else {
-                result = "上传截止时间超期"+(diffDay-days)+"天";
+            if (diffDay < days) {
+                result = "距离上传截止时间还剩" + (days - diffDay) + "天";
+            } else {
+                result = "上传截止时间超期" + (diffDay - days) + "天";
             }
         }
         return result;
@@ -1074,7 +1075,6 @@ public class SetlListUpldService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
         }
         ZyInactpatient zy = dao.huanZheXinXi(patNo, times);
-
         if (zy == null) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未查询到患者信息。");
         }
@@ -1196,7 +1196,7 @@ public class SetlListUpldService {
         //发起审核
         dao.setlModifyReq(param.getInpatientNo(), param.getAdmissTimes(), TokenUtil.getTokenUserId(), param.getOpIdName(), param.getReqRemark());
         //记录审核日志
-        SetlAuditLog setlAuditLog =  cretaSetlAuditLog(param,TokenUtil.getTokenUserId(),0,0);
+        SetlAuditLog setlAuditLog = cretaSetlAuditLog(param, TokenUtil.getTokenUserId(), 0, 0);
         saveAuditLog(setlAuditLog);
         if (ListUtil.notBlank(param.getYbZyDisDiag())) {
             dao.setlModDis(param.getYbZyDisDiag(), "zy_dis_diag_yb_modify");
@@ -1208,7 +1208,7 @@ public class SetlListUpldService {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "申请成功,请等待编码员进行审核。");
     }
 
-    private SetlAuditLog cretaSetlAuditLog(ZyInactpatient param, String tokenUserId,Integer auditFlag,Integer auditType) {
+    private SetlAuditLog cretaSetlAuditLog(ZyInactpatient param, String tokenUserId, Integer auditFlag, Integer auditType) {
         SetlAuditLog setlAuditLog = new SetlAuditLog();
         setlAuditLog.setPatNo(param.getInpatientNo());
         setlAuditLog.setTimes(param.getAdmissTimes());
@@ -1234,7 +1234,7 @@ public class SetlListUpldService {
             // 审核通过需要 删除 并更新 现在占时用不到
 //            dao.delYuanShuJu(req.getPatNo(), req.getTimes());
 //            dao.auditTongGuo(req.getPatNo(), req.getTimes());
-            saveAuditLog(id,auditFlag,remark, auditStaff, auditName, req);
+            saveAuditLog(id, auditFlag, remark, auditStaff, auditName, req);
             return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "审核已通过 (*^▽^*)");
         }
         if (StringUtil.isBlank(remark)) {
@@ -1242,12 +1242,12 @@ public class SetlListUpldService {
         }
         //驳回
         //审核 并 保存审核日志
-        saveAuditLog(id,auditFlag,remark, auditStaff, auditName, req);
+        saveAuditLog(id, auditFlag, remark, auditStaff, auditName, req);
         sendWxInfoService.sendCorpWxMsg(dao.yuanGongGongHao(req.getReqOpId()), String.format("医保结算单上传\n申请已驳回\n患者姓名:【%s】\n住院号:【%s】\n原因:【%s】\n审核人:【%s】", req.getPatName(), req.getPatNo(), remark, auditName));
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "审核已驳回 (╯﹏╰)b");
     }
 
-    private void saveAuditLog(Integer id,Integer auditFlag,String remark, String auditStaff, String auditName, TYbSetlModifyReq req) {
+    private void saveAuditLog(Integer id, Integer auditFlag, String remark, String auditStaff, String auditName, TYbSetlModifyReq req) {
         dao.updateReq(id, remark, auditStaff, auditName);
         dao.upAuditFlag(id, auditFlag);
         SetlAuditLog setlAuditLog = new SetlAuditLog();
@@ -1513,25 +1513,25 @@ public class SetlListUpldService {
         BeanUtil.copyProperties(setlinfo2, setlinfo1);
         BeanUtil.copyProperties(setlinfo5, setlinfo1);
         DrgGroupTestVO drgGroupTestVO = createDrgGroupTestVO(param, setlinfo1);
-        log.info("调用诊断辅助入参:{}",JSON.toJSONString(drgGroupTestVO));
+        log.info("调用诊断辅助入参:{}", JSON.toJSONString(drgGroupTestVO));
         String url = "http://172.16.32.126:8080";
         try {
             String result = drgWebServices.localHelpDrgDagns(drgGroupTestVO);
-            log.info("调用诊断辅助返回结果:{}",result);
-            url +=result;
+            log.info("调用诊断辅助返回结果:{}", result);
+            url += result;
         } catch (Exception e) {
-            log.error( "调用诊断辅助填报接口报错",e);
-            throw new BizException(ExceptionEnum.LOGICAL_ERROR,"调用诊断辅助填报接口报错");
+            log.error("调用诊断辅助填报接口报错", e);
+            throw new BizException(ExceptionEnum.LOGICAL_ERROR, "调用诊断辅助填报接口报错");
         }
-        return ResultVoUtil.success(ExceptionEnum.SUCCESS,ExceptionEnum.SUCCESS.getMessage(),url);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS, ExceptionEnum.SUCCESS.getMessage(), url);
     }
 
-    private DrgGroupTestVO createDrgGroupTestVO(ZyInactpatient param,SetlinfoUpld setlinfoUpld) {
+    private DrgGroupTestVO createDrgGroupTestVO(ZyInactpatient param, SetlinfoUpld setlinfoUpld) {
         DrgGroupTestVO drgGroupTestVO = new DrgGroupTestVO();
-        drgGroupTestVO.setVisit_id(param.getInpatientNo()+"_"+param.getAdmissTimes());    //就诊ID
+        drgGroupTestVO.setVisit_id(param.getInpatientNo() + "_" + param.getAdmissTimes());    //就诊ID
         drgGroupTestVO.setXm(param.getName());    //姓名
         drgGroupTestVO.setBah(param.getInpatientNo());    //病案号
-        drgGroupTestVO.setCysj(DateUtil.formatDatetime(setlinfoUpld.getDscgTime(),"yyyy-MM-dd"));    //出院时间
+        drgGroupTestVO.setCysj(DateUtil.formatDatetime(setlinfoUpld.getDscgTime(), "yyyy-MM-dd"));    //出院时间
         drgGroupTestVO.setXb(param.getSex());    //性别
         drgGroupTestVO.setNl(setlinfoUpld.getAge());    //年龄
         drgGroupTestVO.setZfy(param.getMedfeeSumamt().toString());   //总费用
@@ -1539,40 +1539,41 @@ public class SetlListUpldService {
 
         drgGroupTestVO.setRytj(setlinfoUpld.getAdmWay());    //入院途径
         drgGroupTestVO.setLyfs(setlinfoUpld.getDscgWay());    //	离院方式
-        drgGroupTestVO.setInsur_type_id(StringUtil.isBlank(setlinfoUpld.getHiType())?"":!"310".equals(setlinfoUpld.getHiType())&&!"390".equals(setlinfoUpld.getHiType())?"390":setlinfoUpld.getHiType());    //	病人险种
+        drgGroupTestVO.setInsur_type_id(StringUtil.isBlank(setlinfoUpld.getHiType()) ? "" : !"310".equals(setlinfoUpld.getHiType()) && !"390".equals(setlinfoUpld.getHiType()) ? "390" : setlinfoUpld.getHiType());    //	病人险种
         drgGroupTestVO.setXsecstz(setlinfoUpld.getNwbBirWt());    //	新生儿出生体重(克)
         drgGroupTestVO.setXserytz(setlinfoUpld.getNwbAdmWt());    //新生儿入院体重(克)
         drgGroupTestVO.setBzyzsnl(setlinfoUpld.getNwbAge());    //不足一周岁年龄(天)
-       // 封装诊断
-        if(ListUtil.notBlank(param.getNewYbZyDisDiag())){
-            drgGroupTestVO.setRybq(param.getNewYbZyDisDiag().get(0).getAdmissCond()==null?"":param.getNewYbZyDisDiag().get(0).getAdmissCond().toString());//入院病情
+        // 封装诊断
+        if (ListUtil.notBlank(param.getNewYbZyDisDiag())) {
+            drgGroupTestVO.setRybq(param.getNewYbZyDisDiag().get(0).getAdmissCond() == null ? "" : param.getNewYbZyDisDiag().get(0).getAdmissCond().toString());//入院病情
             drgGroupTestVO.setJbdm(param.getNewYbZyDisDiag().get(0).getDisDiag());
             drgGroupTestVO.setZyzd(param.getNewYbZyDisDiag().get(0).getDisDiagComment());
-            setFieldValue(drgGroupTestVO,"jbdm","disDiag",param.getNewYbZyDisDiag(),1,16);
+            setFieldValue(drgGroupTestVO, "jbdm", "disDiag", param.getNewYbZyDisDiag(), 1, 16);
         }
-       // 封装手术
-        if(ListUtil.notBlank(param.getNewBatjBa4())){
+        // 封装手术
+        if (ListUtil.notBlank(param.getNewBatjBa4())) {
             drgGroupTestVO.setSsjczbm1(param.getNewBatjBa4().get(0).getSsbm());
             drgGroupTestVO.setSsjczmc1(param.getNewBatjBa4().get(0).getSsmc());
-            setFieldValue(drgGroupTestVO,"ssjczbm","ssbm",param.getNewBatjBa4(),2,7);
+            setFieldValue(drgGroupTestVO, "ssjczbm", "ssbm", param.getNewBatjBa4(), 2, 7);
         }
-       return drgGroupTestVO;
+        return drgGroupTestVO;
     }
 
-    private <T> void setFieldValue(DrgGroupTestVO drgGroupTestVO, String fieldName, String targetFieldName, List<T> classList, Integer initSize,int maxSize){
+    private <T> void setFieldValue(DrgGroupTestVO drgGroupTestVO, String fieldName, String targetFieldName, List<T> classList, Integer initSize, int maxSize) {
         if (ListUtil.isBlank(classList)) return;
-        if(initSize==null){
-            initSize=0;
+        if (initSize == null) {
+            initSize = 0;
         }
         for (int i = 1; i < classList.size(); i++) {
-            if(i >=maxSize){
+            if (i >= maxSize) {
                 break;
             }
             Object fieldValue = ReflectUtil.getFieldValue(classList.get(i), targetFieldName);
-            ReflectUtil.setFieldValue(drgGroupTestVO, fieldName+initSize, fieldValue);
+            ReflectUtil.setFieldValue(drgGroupTestVO, fieldName + initSize, fieldValue);
             ++initSize;
         }
     }
+
     /**
      * @description: 发起审核
      * @author: lihong
@@ -1584,39 +1585,40 @@ public class SetlListUpldService {
         try {
             //只有 驳回 或没有审核记录 才能 发起申请
             Integer auditFlag = dao.getAuditFlag(setlAuditLog.getPatNo(), setlAuditLog.getTimes());
-             if(auditFlag == null  || auditFlag == 2){
-                 dao.deleteModifReq(setlAuditLog.getPatNo(),setlAuditLog.getTimes());
-                 dao.setlModifyReq(setlAuditLog.getPatNo(), setlAuditLog.getTimes(), TokenUtil.getTokenUserId(), setlAuditLog.getCreateName(), setlAuditLog.getRemark());
-                 saveAuditLog(setlAuditLog);
-             }else {
-                 throw new BizException(ExceptionEnum.LOGICAL_ERROR,"只有驳回状态或未申请状态才能发起审核流程");
-             }
-        }catch (Exception e){
+            if (auditFlag == null || auditFlag == 2) {
+                dao.deleteModifReq(setlAuditLog.getPatNo(), setlAuditLog.getTimes());
+                dao.setlModifyReq(setlAuditLog.getPatNo(), setlAuditLog.getTimes(), TokenUtil.getTokenUserId(), setlAuditLog.getCreateName(), setlAuditLog.getRemark());
+                saveAuditLog(setlAuditLog);
+            } else {
+                throw new BizException(ExceptionEnum.LOGICAL_ERROR, "只有驳回状态或未申请状态才能发起审核流程");
+            }
+        } catch (Exception e) {
             log.error("发起审核失败", e);
-            throw new BizException(ExceptionEnum.LOGICAL_ERROR,"发起审核失败");
+            throw new BizException(ExceptionEnum.LOGICAL_ERROR, "发起审核失败");
+        }
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "成功");
+    }
+
+    private void saveAuditLog(SetlAuditLog setlAuditLog) {
+        if (setlAuditLog.getAuditType() == null) {
+            setlAuditLog.setAuditType(0);
+        }
+        if (StringUtil.isBlank(setlAuditLog.getRemark())) {
+            setlAuditLog.setRemark("申请审核");
+        }
+        if (setlAuditLog.getAuditFlag() == null) {
+            //设置为待审核
+            setlAuditLog.setAuditFlag(0);
+        }
+        if (StringUtil.isBlank(setlAuditLog.getCreateCode())) {
+            String code = TokenUtil.getTokenUserId();
+            setlAuditLog.setCreateCode(code);
+            setlAuditLog.setCreateName(publicServer.huoQuYuanGongXinXi(code).getName());
         }
-        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION,"成功");
+        log.info("审核参数setlAuditLog:{}", JSON.toJSONString(setlAuditLog));
+        dao.insertSetlAuditLog(setlAuditLog);
     }
 
-   private void saveAuditLog(SetlAuditLog setlAuditLog){
-       if(setlAuditLog.getAuditType()==null){
-           setlAuditLog.setAuditType(0);
-       }
-       if (StringUtil.isBlank(setlAuditLog.getRemark())) {
-           setlAuditLog.setRemark("申请审核");
-       }
-       if (setlAuditLog.getAuditFlag() == null) {
-           //设置为待审核
-           setlAuditLog.setAuditFlag(0);
-       }
-       if (StringUtil.isBlank(setlAuditLog.getCreateCode())) {
-           String code = TokenUtil.getTokenUserId();
-           setlAuditLog.setCreateCode(code);
-           setlAuditLog.setCreateName(publicServer.huoQuYuanGongXinXi(code).getName());
-       }
-       log.info("审核参数setlAuditLog:{}",JSON.toJSONString(setlAuditLog));
-           dao.insertSetlAuditLog(setlAuditLog);
-   }
     /**
      * @description:获取审核日志
      * @author: lihong
@@ -1626,11 +1628,12 @@ public class SetlListUpldService {
      * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
      **/
     public ResultVo<List<SetlAuditLog>> listSetlAuditLog(String patNo, Integer times) {
-        AssertUtil.isnotBlank(patNo,"病案号不能为空");
-        AssertUtil.isnotBlank(times,"住院次数不能为空");
+        AssertUtil.isnotBlank(patNo, "病案号不能为空");
+        AssertUtil.isnotBlank(times, "住院次数不能为空");
         List<SetlAuditLog> setlAuditLogs = dao.listSetlAuditLog(patNo, times);
         return ResultVoUtil.success(setlAuditLogs);
     }
+
     /**
      * @description:结算清单质控测算
      * @author: lihong
@@ -1641,9 +1644,9 @@ public class SetlListUpldService {
     public ResultVo<List<QualityInfoVO>> drgQualityTest(ZyInactpatient param) {
         List<QualityInfoVO> qualityInfoVOS;
         try {
-            String visitId = param.getInpatientNo()+"_"+param.getAdmissTimes();
+            String visitId = param.getInpatientNo() + "_" + param.getAdmissTimes();
             SetlinfoUpld setlinfoUpldInfo = getSetlinfoUpldInfo(param.getInpatientNo(), param.getAdmissTimes(), publicServer.getLedgerSn(param.getInpatientNo(), param.getAdmissTimes()));
-            AssertUtil.isnotBlank(setlinfoUpldInfo,"结算清单基本信息为空");
+            AssertUtil.isnotBlank(setlinfoUpldInfo, "结算清单基本信息为空");
             Map<String, Object> tempMap = BeanUtil.beanToMap(setlinfoUpldInfo, true, true);
             SetlBaseInfoVO setlBaseInfoVO = new SetlBaseInfoVO();
             Map<String, Object> drgQualityParam = new HashMap<>();
@@ -1651,78 +1654,78 @@ public class SetlListUpldService {
             setlBaseInfoVO.setVisit_id(visitId);
             setlBaseInfoVO.setFixmedins_code("H43010500370");
             setlBaseInfoVO.setFixmedins_name("长沙泰和医院");
-            setlBaseInfoVO.setTotal_fee(param.getMedfeeSumamt()==null?null:param.getMedfeeSumamt().toString());
+            setlBaseInfoVO.setTotal_fee(param.getMedfeeSumamt() == null ? null : param.getMedfeeSumamt().toString());
             //格式化一些时间的问题
-            formatSetlBaseInfoVO(setlBaseInfoVO,setlinfoUpldInfo);
+            formatSetlBaseInfoVO(setlBaseInfoVO, setlinfoUpldInfo);
 
-            log.info("setlBaseInfoVO 基本信息传参:{}",JSON.toJSONString(setlBaseInfoVO));
+            log.info("setlBaseInfoVO 基本信息传参:{}", JSON.toJSONString(setlBaseInfoVO));
             drgQualityParam.put("base_info", setlBaseInfoVO);
             //诊断
             //先诊断转码 国临 转医保
-            if(ListUtil.notBlank(param.getNewYbZyDisDiag())){
+            if (ListUtil.notBlank(param.getNewYbZyDisDiag())) {
                 List<String> disCode = param.getNewYbZyDisDiag().stream().map(YbZyDisDiag::getDisDiag).collect(Collectors.toList());
-                List<Map<String, String>> ybDisCodes = dao.listYbDiseOrOprt(disCode,"zd_icd_code_new");
-                List<DiseInfoListVO> diseInfoListVOS = ConvertUtil.ybZyDisDiag2DiseInfoListVO(param.getNewYbZyDisDiag(), visitId,ybDisCodes);
+                List<Map<String, String>> ybDisCodes = dao.listYbDiseOrOprt(disCode, "zd_icd_code_new");
+                List<DiseInfoListVO> diseInfoListVOS = ConvertUtil.ybZyDisDiag2DiseInfoListVO(param.getNewYbZyDisDiag(), visitId, ybDisCodes);
                 drgQualityParam.put("dise_info_list", diseInfoListVOS);
-            }else {
+            } else {
                 drgQualityParam.put("dise_info_list", new ArrayList<>(1));
             }
             //手术
-            if(ListUtil.notBlank(param.getNewBatjBa4())){
+            if (ListUtil.notBlank(param.getNewBatjBa4())) {
                 List<String> oprtCodes = param.getNewBatjBa4().stream().map(BatjBa4::getSsbm).collect(Collectors.toList());
-                List<Map<String, String>> ybOprtCodes = dao.listYbDiseOrOprt(oprtCodes,"zd_icd9_cm3");
+                List<Map<String, String>> ybOprtCodes = dao.listYbDiseOrOprt(oprtCodes, "zd_icd9_cm3");
                 List<String> mzfsCodes = param.getNewBatjBa4().stream().map(BatjBa4::getMzff).collect(Collectors.toList());
                 List<Map<String, String>> ybMzfs = dao.listZdAnaesthesia(mzfsCodes);
                 List<String> ssysCodes = param.getNewBatjBa4().stream().map(BatjBa4::getSsys).collect(Collectors.toList());
                 List<String> mzysCodes = param.getNewBatjBa4().stream().map(BatjBa4::getMzys).collect(Collectors.toList());
-                if(ListUtil.notBlank(mzysCodes)){
+                if (ListUtil.notBlank(mzysCodes)) {
                     ssysCodes.addAll(mzysCodes);
                 }
                 //医生转码
                 List<Map<String, String>> ysCodeDict = dao.listYbSsys(ssysCodes);
-                List<OprtInfoListVO> oprtInfoListVOS = ConvertUtil.batjBa4ToOprtInfoListVO(param.getNewBatjBa4(), visitId, ybOprtCodes,ybMzfs,ysCodeDict);
+                List<OprtInfoListVO> oprtInfoListVOS = ConvertUtil.batjBa4ToOprtInfoListVO(param.getNewBatjBa4(), visitId, ybOprtCodes, ybMzfs, ysCodeDict);
                 drgQualityParam.put("oprt_info_list", oprtInfoListVOS);
-            }else {
+            } else {
                 drgQualityParam.put("oprt_info_list", new ArrayList<>(1));
             }
-            log.info("质控测算传参:{}",JSON.toJSONString(drgQualityParam));
+            log.info("质控测算传参:{}", JSON.toJSONString(drgQualityParam));
             JSONObject resultInfo = drgWebServices.drgQuality(JSON.parseObject(JSON.toJSONString(drgQualityParam)));
-            log.info("质控测算返回:{}",JSON.toJSONString(resultInfo));
-            if(resultInfo.getBooleanValue("isSuccess")){
+            log.info("质控测算返回:{}", JSON.toJSONString(resultInfo));
+            if (resultInfo.getBooleanValue("isSuccess")) {
                 JSONArray jsonArray = resultInfo.getJSONObject("result").getJSONArray("quality_info");
-                if(jsonArray.isEmpty()){
-                    return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION,"没有质控问题数据");
+                if (jsonArray.isEmpty()) {
+                    return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "没有质控问题数据");
                 }
                 qualityInfoVOS = JSON.parseArray(JSON.toJSONString(jsonArray), QualityInfoVO.class);
-            }else {
-                throw new BizException(ExceptionEnum.LOGICAL_ERROR,"创智质控测算接口调用失败");
+            } else {
+                throw new BizException(ExceptionEnum.LOGICAL_ERROR, "创智质控测算接口调用失败");
             }
 
-        }catch (Exception e){
-            if(e instanceof BizException){
-                throw new BizException(ExceptionEnum.LOGICAL_ERROR,e.getMessage());
-            }else {
-                log.error("质控测算报错",e);
-                throw new BizException(ExceptionEnum.LOGICAL_ERROR,"质控测算报错");
+        } catch (Exception e) {
+            if (e instanceof BizException) {
+                throw new BizException(ExceptionEnum.LOGICAL_ERROR, e.getMessage());
+            } else {
+                log.error("质控测算报错", e);
+                throw new BizException(ExceptionEnum.LOGICAL_ERROR, "质控测算报错");
             }
         }
         return ResultVoUtil.success(qualityInfoVOS);
     }
 
     private void formatSetlBaseInfoVO(SetlBaseInfoVO setlBaseInfoVO, SetlinfoUpld setlinfoUpldInfo) {
-       String  timepatten = "yyyy-MM-dd HH:mm:ss";
-        setlBaseInfoVO.setAge(StringUtil.notBlank(setlinfoUpldInfo.getAge())?String.valueOf(new BigDecimal(setlinfoUpldInfo.getAge()).intValue()):null);
-        setlBaseInfoVO.setDcla_time(DateUtil.formatDatetime(setlinfoUpldInfo.getDscgTime(),timepatten));
-        setlBaseInfoVO.setDscg_time(DateUtil.formatDatetime(setlinfoUpldInfo.getDscgTime(),timepatten));
-        setlBaseInfoVO.setAdm_time(DateUtil.formatDatetime(setlinfoUpldInfo.getAdmTime(),timepatten));
+        String timepatten = "yyyy-MM-dd HH:mm:ss";
+        setlBaseInfoVO.setAge(StringUtil.notBlank(setlinfoUpldInfo.getAge()) ? String.valueOf(new BigDecimal(setlinfoUpldInfo.getAge()).intValue()) : null);
+        setlBaseInfoVO.setDcla_time(DateUtil.formatDatetime(setlinfoUpldInfo.getDscgTime(), timepatten));
+        setlBaseInfoVO.setDscg_time(DateUtil.formatDatetime(setlinfoUpldInfo.getDscgTime(), timepatten));
+        setlBaseInfoVO.setAdm_time(DateUtil.formatDatetime(setlinfoUpldInfo.getAdmTime(), timepatten));
         setlBaseInfoVO.setTrt_type(ConvertUtil.TYT_TYPE_MAP.get(setlinfoUpldInfo.getTrtType()));
-        setlBaseInfoVO.setOpsp_mdtrt_date(DateUtil.formatDatetime(setlinfoUpldInfo.getOpspMdtrtDate(),timepatten));
-        setlBaseInfoVO.setSetl_begn_date(DateUtil.formatDatetime(setlinfoUpldInfo.getSetlBegnDate(),timepatten));
-        setlBaseInfoVO.setSetl_end_date(DateUtil.formatDatetime(setlinfoUpldInfo.getSetlEndDate(),timepatten));
+        setlBaseInfoVO.setOpsp_mdtrt_date(DateUtil.formatDatetime(setlinfoUpldInfo.getOpspMdtrtDate(), timepatten));
+        setlBaseInfoVO.setSetl_begn_date(DateUtil.formatDatetime(setlinfoUpldInfo.getSetlBegnDate(), timepatten));
+        setlBaseInfoVO.setSetl_end_date(DateUtil.formatDatetime(setlinfoUpldInfo.getSetlEndDate(), timepatten));
     }
 
 
-    private SetlinfoUpld getSetlinfoUpldInfo(String patNo, Integer times, Integer ledgerSn) throws Exception{
+    private SetlinfoUpld getSetlinfoUpldInfo(String patNo, Integer times, Integer ledgerSn) throws Exception {
         // 患者基本信息
         SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
         EntityCopy.Copy(dao.setlinfo2(patNo, times), setlinfoUpld);
@@ -1736,7 +1739,6 @@ public class SetlListUpldService {
         }
 
 
-
         // 特级护理
         setlinfoUpld.setSpgaNurscareDays(nursingDays(dao.teJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, PublicServer.getInfantFlag(patNo))));
         // 一级护理
@@ -1810,24 +1812,26 @@ public class SetlListUpldService {
         }
         return setlinfoUpld;
     }
+
     /**
      * @description:是否质控通过
      * @author: lihong
      * @date: 2022/12/26 11:01
      * @param: patNo
      * @param: times
-     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
+     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map < java.lang.String, java.lang.Object>>
      **/
     public ResultVo<Map<String, Object>> qualityPass(String patNo, Integer times) {
         Integer auditFlag = dao.qualityPass(patNo, times);
         boolean flag = false;
         Map<String, Object> map = new HashMap<>();
-        if(auditFlag != null && auditFlag==1){
+        if (auditFlag != null && auditFlag == 1) {
             flag = true;
         }
-        map.put("qualityPassFlag",flag);
+        map.put("qualityPassFlag", flag);
         return ResultVoUtil.success(map);
     }
+
     /**
      * @description:是否是在院病人
      * @author: lihong
@@ -1839,7 +1843,7 @@ public class SetlListUpldService {
     public ResultVo<Boolean> isInHospital(String patNo, Integer times) {
         Integer count = dao.isInHospital(patNo, times);
         boolean flag = false;
-        if(count <= 0){
+        if (count <= 0) {
             flag = true;
         }
         return ResultVoUtil.success(flag);
@@ -1869,9 +1873,9 @@ public class SetlListUpldService {
         }
 
 
-
-      return   ResultVoUtil.success(jieSuanDetail);
+        return ResultVoUtil.success(jieSuanDetail);
     }
+
     /**
      * @description:申请撤回审核记录
      * @author: lihong
@@ -1882,23 +1886,24 @@ public class SetlListUpldService {
      **/
     public ResultVo<String> shenQingCheHui(String patNo, Integer times) {
         TYbSetlModifyReq setlModifyReq = dao.getSetlModifyReq(patNo, times);
-        if(setlModifyReq.getAuditFlag() !=null
-                && (setlModifyReq.getAuditFlag()==1 || setlModifyReq.getAuditFlag()==2)
-        ){
+        if (setlModifyReq.getAuditFlag() != null
+                && (setlModifyReq.getAuditFlag() == 1 || setlModifyReq.getAuditFlag() == 2)
+        ) {
             String userId = TokenUtil.getTokenUserId();
-            if(userId.equals(setlModifyReq.getAuditStaff())){
+            if (userId.equals(setlModifyReq.getAuditStaff())) {
                 //删除最近的审核历史记录
-                dao.deletelatestSetlAuditLog(patNo,times);
+                dao.deletelatestSetlAuditLog(patNo, times);
                 //将审核记录置空,还原为待审核状态
-                dao.updateSetlModifyReq(patNo,times);
-            }else {
-                throw new BizException(ExceptionEnum.LOGICAL_ERROR,"当前最新的审核记录不是您,请不要操作撤销!");
+                dao.updateSetlModifyReq(patNo, times);
+            } else {
+                throw new BizException(ExceptionEnum.LOGICAL_ERROR, "当前最新的审核记录不是您,请不要操作撤销!");
             }
-        }else {
-            throw new BizException(ExceptionEnum.LOGICAL_ERROR,"只有审核驳回或审核通过状态才能申请撤销审核操作");
+        } else {
+            throw new BizException(ExceptionEnum.LOGICAL_ERROR, "只有审核驳回或审核通过状态才能申请撤销审核操作");
         }
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "撤销成功");
     }
+
     /**
      * @description:查询审核信息
      * @author: lihong

+ 2 - 3
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -281,13 +281,12 @@ public class YiZhuLuRuServer {
             if (rationalUseOfMedicine.containsKey(key)) {
                 List<String> temp = (List<String>) errorMessageMap.get("error");
                 if (temp == null) {
-                    errorMessageMap.put("error", rationalUseOfMedicine.get(key));
+                    errorMessageMap.put("warning", rationalUseOfMedicine.get(key));
                 } else {
                     temp.addAll(rationalUseOfMedicine.get(key));
                 }
             }
 
-            log.info("错误信息:{}", JSON.toJSONString(errorMessageMap));
             if (!errorMessageMap.isEmpty()) {
                 if (!isThereAnyErrorMessage && errorMessageMap.containsKey("error")) {
                     isThereAnyErrorMessage = true;
@@ -1536,7 +1535,7 @@ public class YiZhuLuRuServer {
             if (rationalUseOfMedicine.containsKey(key)) {
                 List<String> temp = (List<String>) errorMessageMap.get("error");
                 if (temp == null) {
-                    errorMessageMap.put("error", rationalUseOfMedicine.get(key));
+                    errorMessageMap.put("warning", rationalUseOfMedicine.get(key));
                 } else {
                     temp.addAll(rationalUseOfMedicine.get(key));
                 }