Browse Source

门诊处方含有核酸检测的费用时,中止门诊统筹并返回相应提示。

lighter 1 year ago
parent
commit
da59224949

+ 21 - 2
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiMzService.java

@@ -249,15 +249,34 @@ public class SiMzService {
     }
 
     public ResultVo<String> insertSiMzFees(List<MzReceipt> receipts) {
-        receipts.removeIf(item -> !item.getChecked() || item.getChargeItemCode().equals("019110")
-                || item.getChargeItemCode().equals("019180"));
         if (receipts.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "患者没有可以报销的项目!");
         }
+        String hasCovidExamFees = covidExamFeesDetect(receipts);
+        if (StringUtil.notBlank(hasCovidExamFees)) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, hasCovidExamFees);
+        }
         receipts.forEach(dao::insertBatchedMtFeeInfo);
         return ResultVoUtil.success();
     }
 
+    private String covidExamFeesDetect(List<MzReceipt> receipts) {
+        StringBuilder message = new StringBuilder();
+        for (MzReceipt receipt : receipts) {
+            if (receipt.getChargeItemCode().trim().equals("019180")) {
+                message.append("【019180,新型冠状病毒核酸检测】");
+            }
+            if (receipt.getChargeItemCode().trim().equals("019110")) {
+                message.append("【019110,新型冠状病毒2019-ncov核酸检测试剂盒(荧光)】");
+            }
+        }
+        if (message.length() > 0) {
+            message.append("无法上传至医保中心,请单独开具处方。");
+            return "因政策原因," + message;
+        }
+        return null;
+    }
+
     public ResultVo<String> insertSiMzFeesForSupplement(List<MzReceipt> receipts) {
         receipts.removeIf(item -> !item.getChecked() || item.getChargeItemCode().equals("019110")
                 || item.getChargeItemCode().equals("019180"));