浏览代码

结算单手术问题和票据号

DESKTOP-0GD05B0\Administrator 2 年之前
父节点
当前提交
42c2a6a076

+ 2 - 1
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -261,7 +261,8 @@ public interface UpIdCollectionDao {
             "from mz_receipt_serial " +
             "where patient_id = #{patNo} " +
             "and times = #{times} " +
-            " and nullif(receipt_bill, '') is not null ")
+            " and nullif(receipt_bill, '') is not null" +
+            " and obsolete_dcount_no = 0 ")
     String mzBillNo(@Param("patNo") String patNo, @Param("times") Integer times);
 
 

+ 44 - 18
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -38,6 +38,7 @@ import thyyxxk.webserver.entity.querydata.SiSetlinfoTemp;
 import thyyxxk.webserver.entity.querydata.TAutoUploadBill;
 import thyyxxk.webserver.service.PublicServer;
 import thyyxxk.webserver.service.casefrontsheet.CaseFrontSheetMainService;
+import thyyxxk.webserver.service.casefrontsheet.VerifyCaseFrontSheet;
 import thyyxxk.webserver.service.redislike.RedisLikeService;
 import thyyxxk.webserver.service.wxapi.SendWxInfoService;
 import thyyxxk.webserver.utils.*;
@@ -112,7 +113,7 @@ public class SetlListUpldService {
             }
         }
         SetlinfoUpld temp = upldCollection.getData().getSetlinfo();
-        if (!patNo.contains("-")){
+        if (!patNo.contains("-")) {
             if (StringUtil.isBlank(temp.getChfpdrCode())) {
                 errorMessage.append("主诊医师编码为空。");
             }
@@ -233,14 +234,17 @@ public class SetlListUpldService {
         setlinfoUpld.setMedinsFillPsn(getDropdownBox.getName());
         // 医疗机构填报部门
         setlinfoUpld.setMedinsFillDept(getDropdownBox.getDeptName());
-        // 医保机构经办人
+        // 手术
         List<OprninfoUpld> oprninfoUpld = dao.oprninfoUplds(patNo, times, flag == 1 ? "batj_ba4_modify" : "batj_ba4");
-        // 手术计数
-        setlinfoUpld.setOprnOprtCodeCnt(String.valueOf(oprninfoUpld.size()));
 
-        for (int i = 0; i < oprninfoUpld.size(); i++) {
-            // 手术操作类别
-            oprninfoUpld.get(i).setOprnOprtType(i == 0 ? "1" : "2");
+        if (ListUtil.notBlank(oprninfoUpld)) {
+            // 手术计数
+            setlinfoUpld.setOprnOprtCodeCnt(String.valueOf(oprninfoUpld.size()));
+            for (int i = 0; i < oprninfoUpld.size(); i++) {
+                // 手术操作类别
+                oprninfoUpld.get(i).setOprnOprtType(i == 0 ? "1" : "2");
+            }
+
         }
 
         // 离院方式 我们是从 0 开始的所以要加 1
@@ -300,13 +304,17 @@ public class SetlListUpldService {
         // 重症监护时间
         List<IcuinfoUpld> zhongZhenJianHu = getIcuinfoUplds(patNo, times);
         List<PayinfoUpld> payinfo = dao.payinfoUpld(patNo, times, ledgerSn);
-
+        // 诊断
         List<DiseinfoUpld> diseinfos = dao.diseinfo(patNo, times, flag == 1 ? "zy_dis_diag_yb_modify" : "zy_dis_diag_yb");
-        setlinfoUpld.setDiagCodeCnt(String.valueOf(diseinfos.size()));
+        if (ListUtil.notBlank(diseinfos)) {
+            setlinfoUpld.setDiagCodeCnt(String.valueOf(diseinfos.size()));
 
-        for (int i = 0; i < diseinfos.size(); i++) {
-            diseinfos.get(i).setMaindiagFlag(i == 0 ? "1" : "0");
+            for (int i = 0; i < diseinfos.size(); i++) {
+                diseinfos.get(i).setMaindiagFlag(i == 0 ? "1" : "0");
+            }
         }
+
+
         // 新生儿入院类型写死为1
         if (StringUtil.notBlank(setlinfoUpld.getNwbBirWt())) {
             setlinfoUpld.setNwbAdmType("1");
@@ -1037,27 +1045,36 @@ public class SetlListUpldService {
             item.setZycs(param.getAdmissTimes());
             if (!item.getNewData()) {
                 if (item.getSsrq() == null) {
-                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "手术日期不能为空");
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,手术日期不能为空", item.getSsmc()));
                 }
                 if (StringUtil.isBlank(item.getSsys())) {
-                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "手术医生不能为空");
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,手术医生不能为空", item.getSsmc()));
                 }
                 if (StringUtil.isBlank(item.getSsmc())) {
-                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "手术名称不能为空");
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,手术名称不能为空", item.getSsmc()));
                 }
                 if (StringUtil.isBlank(item.getSsjb())) {
-                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "手术级别不能为空");
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,手术级别不能为空", item.getSsmc()));
                 }
                 if (StringUtil.isBlank(item.getSsbm())) {
-                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "手术编码不能为空");
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,手术编码不能为空", item.getSsmc()));
                 }
                 if (StringUtil.isBlank(item.getQkjb()) || StringUtil.isBlank(item.getYhqk())) {
-                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "切口愈合等级不能为空");
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,切口愈合等级不能为空", item.getSsmc()));
+                }
+                if (StringUtil.notBlank(item.getMzys())) {
+                    if (item.getAnstStartDate() == null) {
+                        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,麻醉时间不能为空", item.getSsmc()));
+                    }
+                }
+                List<String> a = VerifyCaseFrontSheet.logicalSurgeryTime(item.getOpStartDate(), item.getOpEndDate(), item.getAnstStartDate(), item.getAnstEndDate());
+                if (ListUtil.notBlank(a)) {
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,%s", item.getSsmc(), a));
                 }
                 try {
                     PublicServer.surgeryTimeLimit(item.getOpStartDate(), item.getOpEndDate(), item.getAnstStartDate(), item.getAnstEndDate());
                 } catch (BizException e) {
-                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "手术名称:【" + item.getSsmc() + "】" + e.getMessage());
+                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("手术:【%s】,手术日期不能为空", item.getSsmc()));
                 }
             }
         }
@@ -1201,6 +1218,15 @@ public class SetlListUpldService {
         return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, result.getString(ERROR_MESSAGE));
     }
 
+    /**
+     * 门诊患者结算单信息
+     *
+     * @param patNo    门诊号
+     * @param times    次数
+     * @param ledgerSn 账页号
+     * @return 返回门诊
+     * @throws Exception
+     */
     public ResultVo<UpldCollection> outpatInformation(String patNo, Integer times, Integer ledgerSn) throws
             Exception {
         UpldCollection upldCollection = new UpldCollection();