Jelajahi Sumber

保存先病案首页质控

lihong 2 tahun lalu
induk
melakukan
20539e8fb6

+ 7 - 1
src/main/java/thyyxxk/webserver/controller/medicalinsurance/SetlListUpldController.java

@@ -196,7 +196,13 @@ public class SetlListUpldController {
     public ResultVo<String> setlModifyReq(@RequestBody ZyInactpatient param) {
         return service.setlModifyReq(param);
     }
-
+    /**
+     * @description: 病案检查
+     * @author: lihong
+     * @date: 2023/1/6 14:47
+     * @param: param
+     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.util.List<thyyxxk.webserver.entity.dictionary.CodeName>>>
+     **/
     @PostMapping("/sheetVerification")
     public ResultVo<Map<String, List<CodeName>>> sheetVerification(@RequestBody ZyInactpatient param) {
         return service.sheetVerification(param);

+ 7 - 0
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/AutoUploadBillDao.java

@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import thyyxxk.webserver.entity.querydata.AutoUploadBill;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -33,4 +36,8 @@ public interface AutoUploadBillDao extends BaseMapper<AutoUploadBill> {
             " )" +
             "</script>")
     void deleteVisitId(List<String> visitIds);
+    @Select("select max(created_date) created_date from t_auto_upload_bill " +
+            " where  pat_no =#{patNo} and times =#{times} and ledger_sn =#{ledgerSn}" +
+            " group by pat_no,times,ledger_sn")
+    Date getLastUpdateTime(@Param("patNo") String patNo, @Param("times")Integer times, @Param("ledgerSn")Integer ledgerSn);
 }

+ 4 - 0
src/main/java/thyyxxk/webserver/entity/querydata/SiSetlinfoTemp.java

@@ -384,6 +384,10 @@ public class SiSetlinfoTemp implements Serializable {
      * 上传状态
      */
     private String uploadStatus;
+    /**
+     * 已上传可以修改提醒
+     */
+    private String uploadUpdateReminder;
 
     private List<PayinfoUpld> payinfo;
     private List<OpspdiseinfoUpld> opspdiseinfo;

+ 13 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/AutoUploadBillService.java

@@ -12,6 +12,7 @@ import thyyxxk.webserver.dao.his.medicalinsurance.AutoUploadBillDao;
 import thyyxxk.webserver.entity.querydata.AutoUploadBill;
 import thyyxxk.webserver.utils.ListUtil;
 
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -33,6 +34,18 @@ public class AutoUploadBillService extends ServiceImpl<AutoUploadBillDao,AutoUpl
         baseMapper.deleteVisitId(visitIds);
         baseMapper.batchSaveData(list);
     }
+    /**
+     * @description:查询病人的最新的上传时间
+     * @author: lihong
+     * @date: 2023/1/6 16:56
+     * @param: patNo
+     * @param: times
+     * @param: ledgerSn
+     * @return: java.util.Date
+     **/
+   public Date getLastUpdateTime(String patNo, Integer times, Integer ledgerSn){
+    return baseMapper.getLastUpdateTime(patNo,times,ledgerSn);
+   }
 
     public IPage<AutoUploadBill> queryPage(AutoUploadBill autoUploadBill){
         IPage<AutoUploadBill> page = new Page(autoUploadBill.getCurrentPage(),autoUploadBill.getPageSize());

+ 22 - 7
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -843,6 +843,7 @@ public class SetlListUpldService {
             if (null != medType) {
                 item.setMedTypeName(medType.getName());
             }
+            item.setUploadUpdateReminder(getUploadUpdateReminder(item.getPatNo(),item.getTimes(),item.getLedgerSn(),item.getSetlListId()));
             item.setUploadStatus(StringUtil.isBlank(item.getSetlListId()) ? "未上传" : "已上传");
             //质控提醒
             boolean qualityPassFlag = isQualityPass(item.getPatNo(),item.getTimes());
@@ -896,6 +897,21 @@ public class SetlListUpldService {
         return ResultVoUtil.success(page);
     }
 
+    private String getUploadUpdateReminder(String patNo, Integer times,Integer ledgerSn,String setlListId) {
+        if(StringUtil.notBlank(setlListId)){
+         Date lastUpdateTimeime = autoUploadBillService.getLastUpdateTime(patNo,times,ledgerSn);
+         if(lastUpdateTimeime !=null){
+             int diff = DateUtil.daysBetween(new Date(), lastUpdateTimeime);
+             if(diff > 5 ){
+                 return "已上传超过【5】天后,医保不能重新上传数据";
+             }else {
+                 return "上传后还剩【"+(diff)+"】天,医保将不能重新上传数据,要修改请尽快";
+             }
+         }
+        }
+        return "";
+    }
+
     private String getQualityReminder(Date setlTime,boolean qualityPassFlag) {
         Date now = new Date();
         int diffDay = DateUtil.daysBetween(now, setlTime);
@@ -1213,11 +1229,6 @@ public class SetlListUpldService {
 
     @Transactional(rollbackFor = Exception.class)
     public ResultVo<String> setlModifyReq(ZyInactpatient param) {
-        param.setLedgerSn(param.getLedgerSn());
-        boolean shiFouQianShouBingAn = dao.shiFouQianShou(param.getInpatientNo(), param.getAdmissTimes()) > 0;
-        if(!shiFouQianShouBingAn){
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该病案没有签收,请病案室签收后再保存");
-        }
         Set<String> zhenDuanBianMa = new HashSet<>();
         for (YbZyDisDiag item : param.getYbZyDisDiag()) {
             if (item.getDisDiagNo() == null || item.getDisDiagNo() <= 0) {
@@ -1823,7 +1834,11 @@ public class SetlListUpldService {
                 if (jsonArray.isEmpty()) {
                     return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "没有质控问题数据");
                 }
-                qualityInfoVOS = JSON.parseArray(JSON.toJSONString(jsonArray), QualityInfoVO.class);
+                List<QualityInfoVO> temp = JSON.parseArray(JSON.toJSONString(jsonArray), QualityInfoVO.class);
+                qualityInfoVOS = temp.stream().filter(obj -> !"disease_name".equals(obj.getField_id())).collect(Collectors.toList());
+                if(ListUtil.isBlank(qualityInfoVOS)){
+                    return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "没有质控问题数据");
+                }
             } else {
                 throw new BizException(ExceptionEnum.LOGICAL_ERROR, "创智质控测算接口调用失败");
             }
@@ -1845,10 +1860,10 @@ public class SetlListUpldService {
         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.setResp_nurs(setlinfoUpldInfo.getRespNursName());
     }