Jelajahi Sumber

特门优化

lihong 1 tahun lalu
induk
melakukan
9b83e95c5f

+ 6 - 33
src/main/java/cn/hnthyy/thmz/controller/mz/MzPatientMiController.java

@@ -662,39 +662,12 @@ 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;
-        }
+    @PostMapping("/fetchSpcSlwinfo")
+    public R fetchSpcSlwinfo(@RequestBody Map<String, Object> query) {
+        String patientId = Convert.toStr(query.get("patientId"));
+        AssertUtil.isNotBlank(patientId, "就诊号不能为空");
+        MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientId);
+        return tsmzService.scdRecord(Convert.toStr(mzPatientMi.getSocialNo(), ""), Convert.toStr(query.get("admdvs"), ""), Convert.toStr(query.get("readCardResult"), ""));
     }
 
 

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

@@ -3,6 +3,7 @@ package cn.hnthyy.thmz.service.impl.thmz;
 import cn.hnthyy.thmz.Utils.AssertUtil;
 import cn.hnthyy.thmz.Utils.HttpUtil;
 import cn.hnthyy.thmz.Utils.JsonUtil;
+import cn.hnthyy.thmz.Utils.R;
 import cn.hnthyy.thmz.common.exception.BizException;
 import cn.hnthyy.thmz.entity.thmz.PayInfo;
 import cn.hnthyy.thmz.entity.thmz.fetchSpcSlwinfo;
@@ -11,6 +12,7 @@ import cn.hnthyy.thmz.service.thmz.TsmzService;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpStatus;
+import cn.hutool.json.JSONUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.json.JSONArray;
@@ -567,4 +569,43 @@ public class TsmzServiceImpl implements TsmzService {
             throw new BizException("试算是否可以修改处方失败");
         }
     }
+
+    /**
+     * @description: 慢特病备案列表
+     * @author: lihong
+     * @date: 2024/3/25 10:14
+     * @param: socialNo 身份证号
+     * @param: admdvs 参保地
+     * @param: readCardResult 电子凭证结果
+     */
+    @Override
+    public R scdRecord(String socialNo, String admdvs, String readCardResult) {
+        String realUrl = tsmzServiceUrl + "/scdRecord";
+        if(StrUtil.isBlank(readCardResult)){
+            AssertUtil.isNotBlank(socialNo,"身份证号不能为空");
+            AssertUtil.isNotBlank(admdvs,"参保地不能为空");
+        }
+        JSONObject jsonObj = new JSONObject();
+        jsonObj.put("socialNo", socialNo);
+        jsonObj.put("admdvs", admdvs);
+        jsonObj.put("readCardResult", readCardResult);
+        log.info("[scdRecord]参数{}:{}:{}",socialNo,admdvs,readCardResult);
+        try {
+            String result = HttpUtil.sendHttpPost(realUrl, jsonObj.toString(), 20000);
+            cn.hutool.json.JSONObject resultJSONO = JSONUtil.parseObj(result);
+            if(resultJSONO == null){
+                throw new BizException("病人特门身份查询失败");
+            }
+            if(Convert.toInt(resultJSONO.get("code")) == HttpStatus.HTTP_OK ){
+                List<fetchSpcSlwinfo> scdRecordVos = JSONUtil.toList(resultJSONO.getJSONArray("data"), fetchSpcSlwinfo.class);
+                return R.ok().put("data",scdRecordVos);
+            }else {
+                log.error("[scdRecord]异常信息:"+resultJSONO.get("message"));
+                throw new BizException("病人特门身份查询失败");
+            }
+        }catch (Exception e){
+            log.error("[scdRecord]异常信息:",e);
+            throw new BizException("病人特门身份查询失败");
+        }
+    }
 }

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

@@ -1,5 +1,6 @@
 package cn.hnthyy.thmz.service.thmz;
 
+import cn.hnthyy.thmz.Utils.R;
 import cn.hnthyy.thmz.entity.thmz.PayInfo;
 import cn.hnthyy.thmz.entity.thmz.fetchSpcSlwinfo;
 
@@ -161,4 +162,13 @@ public interface TsmzService {
      * @return: boolean
      **/
     boolean queryModifyPermission(String patientId, Integer times,String staffId);
+    /**
+     * @description: 慢特病备案列表
+     * @author: lihong
+     * @date: 2024/3/25 10:14
+     * @param: socialNo 身份证号
+     * @param: admdvs 参保地
+     * @param: readCardResult 电子凭证结果
+     **/
+    R scdRecord(String socialNo, String admdvs, String readCardResult);
 }

+ 96 - 57
src/main/resources/static/js/mz/clinic.js

@@ -62,7 +62,7 @@ $(function () {
     //初始用药方式下拉选
     initSupplyTypes();
 
-
+    initAdvmPro('visitAdvmPro');
     //加载候诊患者列表
     loadUnClinicTableList();
     //加载接诊中患者列表
@@ -1531,7 +1531,7 @@ function clearUser(flag) {
     $("#crbMainCard").css("display", "none");
     $("#editUser").css("display", "none");
     $("#clearUser").css("display", "none");
-    $("#fetchSpcSlwinfo").css("display", "none");
+    // $("#fetchSpcSlwinfo").css("display", "none");
     $("#patientPhone").html("");
     $("#patientPhoneLabel").hide();
     $("#patientResponseType").html("");
@@ -2037,7 +2037,7 @@ function setMzPatientInfo(mzPatientMi) {
     }
     $("#patientHisData").text(mzPatientMi.name);
     fitPatientHisData();
-    setTmResponseType(mzPatientMi.patientId);
+    // setTmResponseType(mzPatientMi.patientId);
 }
 
 //设置病人身份
@@ -2059,25 +2059,19 @@ function setVisitTypeName(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");
-                }
+    postAjaxJsonHttpRequst("/thmz/fetchSpcSlwinfo",{"patientId":patientId,"admdvs":"","readCardResult":""},true,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");
             }
         }
-    });
+    })
+
 }
 
 //删除股东卡身份
@@ -2131,17 +2125,94 @@ function cmrCreate() {
     });
 }
 
-
+function openFetchSpcSlwinfoModal() {
+    $("#fetchSpcSlwinfoModal").modal();
+    $("#fetchSpcSlwinfoTable").html(null);
+    visitMtCardResult = null;
+}
 
 /**
  * 特门详情
  * @param patientId
  */
 function fetchSpcSlwinfo() {
-    var patientId = $("#patientId").text();
+    let patientId = $("#patientId").text();
+    let visitAdvmCity = $("#visitAdvmCity").val();
+    postAjaxJsonHttpRequst("/thmz/fetchSpcSlwinfo",{"patientId":patientId,"admdvs":visitAdvmCity,"readCardResult":visitMtCardResult},true,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 ){
+                errorMesageSimaple("该患者没有特门信息");
+            }
+            if (res.data != null && res.data.length > 0) {
+                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");
+                }
+            } else {
+                errorMesage(res);
+            }
+        } else {
+            errorMesage(res);
+        }
+    })
+}
+
+function initAdvmPro(proId) {
+    getAjaxRequst("/thmz/queryProvinceCodes",{},true,function (res) {
+        if(res.code == 0 && res.data !=null && res.data.length > 0){
+            let selectHtml = '';
+            for (let i=0 ; i <res.data.length; i++ ){
+                selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
+            }
+            $('#'+proId).html(selectHtml);
+            $('#'+proId).selectpicker('refresh');
+        }
+    })
+}
+
+function cityChange(proId,cityId) {
+    let code = $('#'+proId).val()
+    postAjaxJsonHttpRequst("/thmz/queryCityCodes",{code:code},true,function (res) {
+        if(res.code == 0 && res.data !=null && res.data.length > 0){
+            let selectHtml = '';
+            for (let i=0 ; i <res.data.length; i++ ){
+                selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
+            }
+            $('#'+cityId).html(selectHtml);
+            $('#'+cityId).selectpicker('refresh');
+        }
+    })
+}
+
+var visitMtCardResult = null;
+
+function readVisitPatientCard() {
     $.ajax({
         type: "GET",
-        url: '/thmz/fetchSpcSlwinfo?patientId=' + patientId,
+        url: 'http://localhost:8321/readcard/entry?param=qrcode_01101',
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
@@ -2150,40 +2221,8 @@ function fetchSpcSlwinfo() {
                 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);
-                }
+            if (res.code == 200) {
+                visitMtCardResult = res.data
             } else {
                 errorMesage(res);
             }

+ 33 - 17
src/main/resources/templates/mz/clinic.html

@@ -378,7 +378,7 @@
                         <span>性别: </span> <label><span id="patientGender"></span></label>&nbsp;&nbsp;
                         <label style="font-weight:normal" id="patientPhoneLabel" hidden><span>手机号: </span> <label><span
                                 id="patientPhone"></span></label>&nbsp;&nbsp;</label>
-                        <span>病人性质: </span> <label><span id="patientResponseType"></span></label>
+<!--                        <span>病人性质: </span> <label><span id="patientResponseType"></span></label>-->
                         <span>病人身份: </span> <label><a class="fa fa-futbol-o"></a>&nbsp;&nbsp;<span id="patientVisitType" style="color: red;font-weight:bold"></span></label>
                         <span>慢病类型: </span> <label><span id="crmType"></span></label>
                         <!--当前接诊病人id-->
@@ -399,9 +399,9 @@
                         <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;margin-right: 10px;display: none"
                            onclick="crbMainCard()" id="crbMainCard"><i
                                 class="fa fa-file-word-o">&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: inline-block"
+                           onclick="openFetchSpcSlwinfoModal()" 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(null,1)" id="editUser"><i
                                 class="fa fa-edit">&nbsp;&nbsp;编辑</i></a>
@@ -3316,22 +3316,38 @@
             </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>
+                <div class="item form-group">
+                    <label class="col-md-1 col-sm-1 col-xs-12">
+                    </label>
+                    <label class="col-md-3 col-sm-3 col-xs-12">参保地
+                    </label>
+                    <label class="col-md-3 col-sm-3 col-xs-12" for="visitAdvmPro">
+                        <select class="form-control selectpicker show-tick"  data-live-search="true"
+                                id="visitAdvmPro" onchange="cityChange('visitAdvmPro','visitAdvmCity')" title="参保地省"></select>
+                    </label>
+                    <label class="col-md-3 col-sm-3 col-xs-12" for="visitAdvmCity">
+                        <select class="form-control selectpicker show-tick"  data-live-search="true"
+                                id="visitAdvmCity" onchange="" title="参保地市"></select>
+                    </label>
+                </div>
+                <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-success" onclick="readVisitPatientCard()" >读取电子凭证</button>
+                <button type="button" class="btn btn-primary" onclick="fetchSpcSlwinfo()" >查询</button>
                 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
             </div>
         </div>