Browse Source

费用结算添加护士退药单的判断

lighter 2 years ago
parent
commit
1af87f3572

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>11.2.7</version>
+    <version>11.3.2</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 1 - 0
src/main/java/thyyxxk/webserver/config/exception/ExceptionEnum.java

@@ -20,6 +20,7 @@ public enum ExceptionEnum {
     NETWORK_ERROR(1003, "网络异常!"),
     EXIST_NEGATIVE_FEES(1004, "此患者费用清单存在负数。"),
     EXIST_UNHANDLED_DRUG_ORDER(1104, "此患者有未处理的药单,请联系药房处理。"),
+    EXIST_UNHANDLED_REFUND_DRUG(1105, "此患者有未处理的护士退药单。"),
     NO_DATA_EXIST(1005, "没有查询到符合条件的数据。"),
     ABNORMAL_YZ_ACT_ORDER(1006, "此患者存在异常状态医嘱。"),
     INVALID_PARAM(1007, "参数异常,请检查。"),

+ 4 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/DismissDao.java

@@ -79,6 +79,10 @@ public interface DismissDao {
             "(case when a.amount>0 then a.page_no else a.page_no_ty end>0) and a.group_no=b.group_no and a.status_flag='1'")
     List<IllegalFee> hasUntreatedDrugOrder(@Param("patNo") String patNo, @Param("times") Integer times);
 
+    @Select("select page_no_ty from yz_yp_zy_order where inpatient_no=#{patNo} " +
+            "and admiss_times=#{times} and page_class='HT' and status_flag='1'")
+    List<IllegalFee> selectPageNoTys(@Param("patNo") String patNo, @Param("times") Integer times);
+
     @Select("SELECT count(1) FROM yz_zy_patient_fee WHERE inpatient_no=#{patNo} " +
             "AND admiss_times=#{times} and charge_date<=#{actOrderDisDate} AND " +
             "charge_fee <> 0 and charge_status='3'")

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/dismiss/IllegalFee.java

@@ -18,4 +18,5 @@ public class IllegalFee {
     private String groupName;
     private String pageNo;
     private String pageNoTy;
+    private String remark;
 }

+ 15 - 3
src/main/java/thyyxxk/webserver/service/inpatient/DismissService.java

@@ -62,7 +62,7 @@ public class DismissService {
         Integer retcode = response.getInteger("return_code");
         if (null != retcode && retcode == 1) {
             JSONArray retdata = response.getJSONArray("return_data");
-            if (null == retdata || retdata.size() == 0) {
+            if (null == retdata || retdata.isEmpty()) {
                 return ResultVoUtil.success();
             }
             return ResultVoUtil.fail(ExceptionEnum.PRE_DISCHARGE_ERROR, retdata);
@@ -245,16 +245,28 @@ public class DismissService {
             throw new BizException(exception);
         }
         List<IllegalFee> unhandledList = dao.hasUntreatedDrugOrder(patNo, times);
-        if (unhandledList.size() > 0) {
+        if (!unhandledList.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.EXIST_UNHANDLED_DRUG_ORDER, unhandledList);
         }
+        List<IllegalFee> refundDrugs = dao.selectPageNoTys(patNo, times);
+        if (!refundDrugs.isEmpty()) {
+            for (IllegalFee drug : refundDrugs) {
+                if (drug.getPageNoTy().equals("-1")) {
+                    drug.setPageNoTy("未提交");
+                    drug.setRemark("请护士提交退药单。");
+                } else {
+                    drug.setRemark("请联系药房处理。");
+                }
+            }
+            return ResultVoUtil.fail(ExceptionEnum.EXIST_UNHANDLED_REFUND_DRUG, refundDrugs);
+        }
         if (dao.hasUnconfirmedMedicalTech(patNo, times, tmpendtime) > 0) {
             ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
             exception.setMessage("此患者有未确认的医技。");
             throw new BizException(exception);
         }
         List<IllegalFee> feeNegativeList = dao.feeOrderNegative(patNo, times);
-        if (feeNegativeList.size() > 0) {
+        if (!feeNegativeList.isEmpty()) {
             return ResultVoUtil.fail(ExceptionEnum.EXIST_NEGATIVE_FEES, feeNegativeList);
         }
         if (dao.hasSettled(patNo, times, ledgerSn) != 0) {