Browse Source

新增特门病种查询功能

hurugang 3 years ago
parent
commit
c2c7f2d4d0

+ 47 - 1
src/main/java/cn/hnthyy/thmz/controller/mz/MzPatientMiController.java

@@ -5,8 +5,10 @@ import cn.hnthyy.thmz.Utils.SeedUtil;
 import cn.hnthyy.thmz.Utils.StringUtil;
 import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.entity.his.mz.MzPatientMi;
+import cn.hnthyy.thmz.entity.thmz.fetchSpcSlwinfo;
 import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.service.his.mz.MzPatientMiService;
+import cn.hnthyy.thmz.service.thmz.TsmzService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,7 +24,8 @@ import java.util.Map;
 public class MzPatientMiController {
     @Autowired
     private MzPatientMiService mzPatientMiService;
-
+    @Autowired
+    private TsmzService tsmzService;
     /**
      * 根据病人就诊卡号查询病人信息
      *
@@ -53,6 +56,7 @@ public class MzPatientMiController {
     }
 
 
+
 //    /**
 //     * 根据病人姓名查询病人信息
 //     *
@@ -475,4 +479,46 @@ public class MzPatientMiController {
         }
     }
 
+
+    /**
+     * 获取病人特门信息
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/fetchSpcSlwinfo", method = {RequestMethod.GET})
+    public Map<String, Object> fetchSpcSlwinfo(@RequestParam("patientId") String patientId) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (StringUtils.isBlank(patientId)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人id不能为空");
+                return resultMap;
+            }
+            MzPatientMi mzPatientMi= mzPatientMiService.queryByPatientId(patientId);
+            if(mzPatientMi==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人不存在");
+                return resultMap;
+            }
+            if(StringUtils.isNotBlank(mzPatientMi.getSocialNo())){
+                List<fetchSpcSlwinfo> fetchSpcSlwinfoList= tsmzService.fetchSpcSlwinfo(mzPatientMi.getSocialNo());
+                if(fetchSpcSlwinfoList!=null && fetchSpcSlwinfoList.size()>0){
+                    resultMap.put("code", 0);
+                    resultMap.put("data", fetchSpcSlwinfoList);
+                    return resultMap;
+                }
+            }
+            resultMap.put("code", -1);
+            resultMap.put("message", "当前病人无特门信息");
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            resultMap.put("code", -1);
+            resultMap.put("message", "系统出错,请联系管理员");
+            log.error("系统异常,错误信息{}", e);
+            return resultMap;
+        }
+    }
+
 }

+ 20 - 0
src/main/java/cn/hnthyy/thmz/entity/thmz/fetchSpcSlwinfo.java

@@ -0,0 +1,20 @@
+package cn.hnthyy.thmz.entity.thmz;
+
+import lombok.Data;
+
+/**
+ * 特门信息
+ */
+@Data
+public class fetchSpcSlwinfo {
+    //开始时间
+    private String begndate;
+    //结束时间
+    private String enddate;
+    //特门病种名称
+    private String opspDiseName;
+    //特门病种编码
+    private String opspDiseCode;
+    //备案机构名称
+    private String ideFixmedinsName;
+}

+ 45 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TsmzServiceImpl.java

@@ -2,15 +2,20 @@ package cn.hnthyy.thmz.service.impl.thmz;
 
 import cn.hnthyy.thmz.Utils.HttpUtil;
 import cn.hnthyy.thmz.entity.thmz.PayInfo;
+import cn.hnthyy.thmz.entity.thmz.fetchSpcSlwinfo;
 import cn.hnthyy.thmz.service.thmz.TsmzService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.json.JSONArray;
 import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 @Slf4j
 @Service
@@ -145,4 +150,44 @@ public class TsmzServiceImpl implements TsmzService {
         return null;
     }
 
+    @Override
+    public List<fetchSpcSlwinfo> fetchSpcSlwinfo(String idCard) {
+        try {
+            String result=HttpUtil.sendHttpGet(tsmzServiceUrl + "/fetchSpcSlwinfo?socialNo="+idCard, "utf-8");
+            if(StringUtils.isBlank(result)){
+                return null;
+            }
+            JSONObject resultJSONO =  new JSONObject(result);
+            if(resultJSONO==null){
+                return null;
+            }
+            if((int)resultJSONO.get("code")==200){
+                JSONArray jsonArray=(JSONArray)resultJSONO.get("data");
+                if(jsonArray==null || jsonArray.length()==0){
+                    return null;
+                }
+                List<fetchSpcSlwinfo> fetchSpcSlwinfos= new ArrayList<>();
+                for(int i=0;i<jsonArray.length();i++){
+                    JSONObject jsonObject = jsonArray.getJSONObject(i);
+                    if(jsonObject==null){
+                        continue;
+                    }
+                    fetchSpcSlwinfo fetchSpcSlwinfo = new fetchSpcSlwinfo();
+                    fetchSpcSlwinfo.setBegndate((String) jsonObject.get("begndate"));
+                    fetchSpcSlwinfo.setEnddate((String) jsonObject.get("enddate"));
+                    fetchSpcSlwinfo.setOpspDiseName((String) jsonObject.get("opspDiseName"));
+                    fetchSpcSlwinfo.setOpspDiseCode((String) jsonObject.get("opspDiseCode"));
+                    fetchSpcSlwinfo.setIdeFixmedinsName((String) jsonObject.get("ideFixmedinsName"));
+                    fetchSpcSlwinfos.add(fetchSpcSlwinfo);
+                }
+                return fetchSpcSlwinfos;
+            }
+            log.info("查询特门病人信息成功");
+        } catch (IOException e) {
+            e.printStackTrace();
+            log.error("查询特门病人信息失败");
+        }
+        return null;
+    }
+
 }

+ 10 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/TsmzService.java

@@ -1,7 +1,9 @@
 package cn.hnthyy.thmz.service.thmz;
 
 import cn.hnthyy.thmz.entity.thmz.PayInfo;
+import cn.hnthyy.thmz.entity.thmz.fetchSpcSlwinfo;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -46,4 +48,12 @@ public interface TsmzService {
      * @return
      */
     PayInfo calculateCost(String staffId,String patientId,Integer times,Integer receiptNo);
+
+
+    /**
+     * 获取病人特门信息
+     * @param idCard 身份证号码
+     * @return
+     */
+    List<fetchSpcSlwinfo> fetchSpcSlwinfo(String idCard);
 }

+ 90 - 0
src/main/resources/static/js/mz/clinic.js

@@ -771,6 +771,7 @@ function clearUser(flag) {
     $("#patientId").text(null);
     $("#editUser").css("display", "none");
     $("#clearUser").css("display", "none");
+    $("#fetchSpcSlwinfo").css("display", "none");
     $("#patientPhone").html("");
     $("#patientPhoneLabel").hide();
     $("#patientResponseType").html("");
@@ -1234,8 +1235,97 @@ function setMzPatientInfo(mzPatientMi) {
     }
     $("#patientHisData").text(mzPatientMi.name);
     fitPatientHisData();
+    setTmResponseType(mzPatientMi.patientId);
+
+}
+
+/**
+ * 判断是否是特门病人
+ * @param patientId
+ */
+function setTmResponseType(patientId) {
+    $.ajax({
+        type: "GET",
+        url: '/thmz/fetchSpcSlwinfo?patientId=' + patientId,
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                if (res.data != null && res.data.length>0) {
+                    $("#patientResponseType").html("特殊门诊");
+                    $("#fetchSpcSlwinfo").css("display", "inline-block");
+                }
+            }
+        }
+    });
+}
+
+
+
+/**
+ * 特门详情
+ * @param patientId
+ */
+function fetchSpcSlwinfo() {
+    var patientId=$("#patientId").text();
+    $.ajax({
+        type: "GET",
+        url: '/thmz/fetchSpcSlwinfo?patientId=' + patientId,
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                if (res.data != null && res.data.length > 0) {
+                    $("#fetchSpcSlwinfoModal").modal();
+                    $("#fetchSpcSlwinfoTable").html(null);
+                    for (var i = 0; i < res.data.length; i++) {
+                        var begndate = res.data[i].begndate;
+                        if (begndate == null || begndate == "null") {
+                            begndate = "";
+                        }
+                        var enddate = res.data[i].enddate;
+                        if (enddate == null || enddate == "null") {
+                            enddate = "";
+                        }
+                        var opspDiseName = res.data[i].opspDiseName;
+                        if (opspDiseName == null || opspDiseName == "null") {
+                            opspDiseName = "";
+                        }
+                        var opspDiseCode = res.data[i].opspDiseCode;
+                        if (opspDiseCode == null || opspDiseCode == "null") {
+                            opspDiseCode = "";
+                        }
+                        var ideFixmedinsName = res.data[i].ideFixmedinsName;
+                        if (ideFixmedinsName == null || ideFixmedinsName == "null") {
+                            ideFixmedinsName = "";
+                        }
+                        $("<tr><td>" + begndate + "</td><td>" + enddate + "</td><td>" + opspDiseCode + "</td><td>" + opspDiseName + "</td><td>" + ideFixmedinsName + "</td></tr>").appendTo("#fetchSpcSlwinfoTable");
+                        //     .bind('click', function () {
+                        //     $("#fetchSpcSlwinfoModal").modal("hide");
+                        //     clinicalReception(patientIdDb, $(this).attr("data-target"));
+                        // });
+                    }
+                } else {
+                    errorMesage(res);
+                }
+            } else {
+                errorMesage(res);
+            }
+        }
+    });
 }
 
+
 /**
  * 真实的接诊方法
  * @param patientId

+ 13 - 13
src/main/resources/templates/menu.html

@@ -164,46 +164,46 @@
                                     <a>
                                         <span class="image"><img id="headImage1" src="" alt="Profile Image"/></span>
                                         <span>
-                                          <span>John Smith</span>
-                                          <span class="time">3 mins ago</span>
+                                          <span>系统通知</span>
+                                          <span class="time">3分钟前</span>
                                         </span>
-                                        <span class="message">Film festivals used to be do-or-die moments for movie makers. They were where...</span>
+                                        <span class="message">对于电影制作人来说,电影节曾经是生死攸关的时刻。他们在那里……</span>
                                     </a>
                                 </li>
                                 <li>
                                     <a>
                                         <span class="image"><img id="headImage2" src="" alt="Profile Image"/></span>
                                         <span>
-                                          <span>John Smith</span>
-                                          <span class="time">3 mins ago</span>
+                                          <span>系统通知</span>
+                                          <span class="time">3分钟前</span>
                                         </span>
-                                        <span class="message">Film festivals used to be do-or-die moments for movie makers. They were where...</span>
+                                        <span class="message">对于电影制作人来说,电影节曾经是生死攸关的时刻。他们在那里……</span>
                                     </a>
                                 </li>
                                 <li>
                                     <a>
                                         <span class="image"><img id="headImage3" src="" alt="Profile Image"/></span>
                                         <span>
-                                          <span>John Smith</span>
-                                          <span class="time">3 mins ago</span>
+                                          <span>系统通知</span>
+                                          <span class="time">3分钟前</span>
                                         </span>
-                                        <span class="message">Film festivals used to be do-or-die moments for movie makers. They were where...</span>
+                                        <span class="message">对于电影制作人来说,电影节曾经是生死攸关的时刻。他们在那里……</span>
                                     </a>
                                 </li>
                                 <li>
                                     <a>
                                         <span class="image"><img id="headImage4" src="" alt="Profile Image"/></span>
                                         <span>
-                                          <span>John Smith</span>
-                                          <span class="time">3 mins ago</span>
+                                          <span>系统通知</span>
+                                          <span class="time">3分钟前</span>
                                         </span>
-                                        <span class="message">Film festivals used to be do-or-die moments for movie makers. They were where...</span>
+                                        <span class="message">对于电影制作人来说,电影节曾经是生死攸关的时刻。他们在那里……</span>
                                     </a>
                                 </li>
                                 <li>
                                     <div class="text-center">
                                         <a>
-                                            <strong>See All Alerts</strong>
+                                            <strong>查看所有通知</strong>
                                             <i class="fa fa-angle-right"></i>
                                         </a>
                                     </div>

+ 39 - 3
src/main/resources/templates/mz/clinic.html

@@ -355,9 +355,9 @@
                         <input type="hidden" id="mzfzSerialNoInClick"/>
                     </div>
                     <div class="col-md-4 col-sm-4 col-xs-12" style="text-align: right;">
-                       <!-- <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;margin-right: 10px;"
-                           onclick="beHospitalized()"><i
-                                class="fa fa-sign-in">&nbsp;&nbsp;入院处理</i></a>-->
+                       <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;margin-right: 10px;display: none"
+                           onclick="fetchSpcSlwinfo()" id="fetchSpcSlwinfo"><i
+                                class="fa fa-eye">&nbsp;&nbsp;特门详情</i></a>
                         <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;margin-right: 10px;display: none"
                            onclick="editUserModal()" id="editUser"><i
                                 class="fa fa-edit">&nbsp;&nbsp;编辑</i></a>
@@ -2173,6 +2173,42 @@
 </div>
 <!--分诊列表弹窗结尾-->
 
+
+
+<!--特门详情列表弹窗开始-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="fetchSpcSlwinfoModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content" style="width: 700px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title modal-title-thmz">特殊门诊病种列表</h4>
+            </div>
+            <div class="modal-body">
+                <form class="form-horizontal form-label-left" novalidate>
+                    <table class="table table-striped table-bordered">
+                        <thead>
+                        <tr>
+                            <th>开始日期</th>
+                            <th>结束日期</th>
+                            <th>病种编码</th>
+                            <th>病种名称</th>
+                            <th>备案机构</th>
+                        </tr>
+                        </thead>
+                        <tbody id="fetchSpcSlwinfoTable">
+                        </tbody>
+                    </table>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--特门详情列表弹窗结尾-->
+
 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
     <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
 </object>