Selaa lähdekoodia

增加出院医嘱校验

hurugang 4 vuotta sitten
vanhempi
commit
4b54003c40

+ 54 - 1
src/main/java/cn/hnthyy/thmz/controller/zy/ZyLederFileController.java

@@ -4,6 +4,7 @@ import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.entity.his.mz.Employee;
 import cn.hnthyy.thmz.entity.his.zy.ZyLedgerFile;
 import cn.hnthyy.thmz.service.his.mz.EmployeeService;
+import cn.hnthyy.thmz.service.his.yz.YzActOrderService;
 import cn.hnthyy.thmz.service.his.zy.ZyLedgerFileService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -21,7 +22,8 @@ public class ZyLederFileController {
     private ZyLedgerFileService zyLedgerFileService;
     @Autowired
     private EmployeeService employeeService;
-
+    @Autowired
+    private YzActOrderService yzActOrderService;
 
     /**
      * 查询病人当次住院的账页信息
@@ -101,4 +103,55 @@ public class ZyLederFileController {
             return resultMap;
         }
     }
+
+
+
+
+    /**
+     * 查看病人的结算信息
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/settlementInfo", method = {RequestMethod.GET})
+    public Map<String, Object> settlementInfo(@RequestParam("inpatientNo") String inpatientNo,@RequestParam("admissTimes") Integer admissTimes) {
+        log.info("查看病人的结算信息");
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (StringUtils.isBlank(inpatientNo)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "住院号不能为空");
+                return resultMap;
+            }
+            if(admissTimes==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "住院次数不能为空");
+                return resultMap;
+            }
+            String yzDate= yzActOrderService.queryLeaveOrderDate(inpatientNo,admissTimes);
+            if(StringUtils.isBlank(yzDate)){
+                resultMap.put("code", -1);
+                resultMap.put("message", "当前病人没有出院医嘱,不可进行出院处理!");
+                return resultMap;
+            }
+            Integer ledgerSn= zyLedgerFileService.queryCurrentLedgerSn(inpatientNo, admissTimes);
+            if(ledgerSn!=null){
+                resultMap.put("code", -2);
+                resultMap.put("message", "病人有尚未结算的费用,确定出院吗?");
+                return resultMap;
+            }
+            resultMap.put("code", 0);
+            resultMap.put("message", "查看病人的结算信息成功");
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            resultMap.put("code", -1);
+            resultMap.put("message", "查看病人的结算信息出错,请联系管理员");
+            log.error("查看病人的结算信息异常,错误信息{}", e.getMessage());
+            return resultMap;
+        }
+    }
+
+
+
 }

+ 35 - 11
src/main/resources/static/js/actpatient.js

@@ -327,9 +327,9 @@ function initFeeTable() {
                         if (row.settleType == 0) {
                             str += '<button type="button" class="registration-no-color-foot-button"title="出院结算" onclick="settlement(\'' + row.inpatientNo + '\',' + row.admissTimes + ')"><i class="fa fa-credit-card"></i></button>';
                         }
-                        str += '<button type="button" class="registration-no-color-foot-button"title="立即出院" onclick="leaveHospital(\'' + row.inpatientNo + '\',' + row.admissTimes + ')"><i class="fa fa-sign-out"></i></button>';
+                        str += '<button type="button" class="registration-no-color-foot-button"title="立即出院" onclick="leaveHospital(\'' + row.inpatientNo + '\',' + row.admissTimes + ',\''+row.name+'\')"><i class="fa fa-sign-out"></i></button>';
                     } else if (payMarkGroup == 1) {
-                        str += '<button type="button" class="registration-no-color-foot-button"title="出院召回" onclick="recall(\'' + row.inpatientNo + '\',' + row.admissTimes + ')"><i class="fa fa-reply-all"></i></button>';
+                        str += '<button type="button" class="registration-no-color-foot-button"title="出院召回" onclick="recall(\'' + row.inpatientNo + '\',' + row.admissTimes + ',\''+row.name+'\')"><i class="fa fa-reply-all"></i></button>';
                         if (row.settleType == 0) {
                             str += '<button type="button" class="registration-no-color-foot-button"title="出院结算" onclick="settlement(\'' + row.inpatientNo + '\',' + row.admissTimes + ')"><i class="fa fa-credit-card"></i></button>';
                         } else if (row.settleType == 1) {
@@ -568,13 +568,14 @@ function showZyLedgerFile(row) {
  * @param inpatientNo
  * @param admissTimes
  */
-function leaveHospital(inpatientNo, admissTimes) {
-    if (!confirm("确定要将住院号为【" + inpatientNo.trim() + "】,住院次数为【" + admissTimes + "】的病人住院记录进行直接出院吗?")) {
+function leaveHospital(inpatientNo, admissTimes,name) {
+    if (!confirm("确定要将病人【" + name.trim() + "】,置为出院状态吗?")) {
         return;
     }
+
     $.ajax({
         type: "GET",
-        url: '/thmz/leaveHospital?inpatientNo=' + inpatientNo + "&admissTimes=" + admissTimes,
+        url: '/thmz/settlementInfo?inpatientNo=' + inpatientNo + "&admissTimes=" + admissTimes,
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
@@ -584,14 +585,37 @@ function leaveHospital(inpatientNo, admissTimes) {
                 window.location.href = '/thmz/login/view';
                 return;
             }
-            if (res.code == 0) {
-                $('#tb_table').bootstrapTable("refresh");
-                successMesage(res);
-            } else {
+            if (res.code == -2) {
+                if (!confirm(res.message)) {
+                    return;
+                }
+            } else if (res.code == -1){
                 errorMesage(res);
+                return;
             }
+            $.ajax({
+                type: "GET",
+                url: '/thmz/leaveHospital?inpatientNo=' + inpatientNo + "&admissTimes=" + admissTimes,
+                contentType: "application/json;charset=UTF-8",
+                dataType: "json",
+                headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+                async: false,
+                success: function (res) {
+                    if (res == '401' || res == 401) {
+                        window.location.href = '/thmz/login/view';
+                        return;
+                    }
+                    if (res.code == 0) {
+                        $('#tb_table').bootstrapTable("refresh");
+                        successMesage(res);
+                    } else {
+                        errorMesage(res);
+                    }
+                }
+            });
         }
     });
+
 }
 
 
@@ -600,8 +624,8 @@ function leaveHospital(inpatientNo, admissTimes) {
  * @param inpatientNo
  * @param admissTimes
  */
-function recall(inpatientNo, admissTimes) {
-    if (!confirm("确定要将住院号为【" + inpatientNo.trim() + "】,住院次数为【" + admissTimes + "】的病人住院记录进行召回吗?")) {
+function recall(inpatientNo, admissTimes,name) {
+    if (!confirm("确定要将病人【" + name.trim() + "】,做召回处理吗?")) {
         return;
     }
     $.ajax({