lihong 1 年之前
父節點
當前提交
a141235396

+ 4 - 0
src/main/java/cn/hnthyy/thmz/common/Constants.java

@@ -301,6 +301,10 @@ public class Constants {
      * 单病种收费员编码
      */
     public static final String DBZJF_NAME = "单病种收费员";
+    /**
+     * 单病种编码
+     */
+    public static final String DBZ_CODE = "ae";
 
     /**
      * 120卡号

+ 8 - 2
src/main/java/cn/hnthyy/thmz/controller/zy/APatientMiController.java

@@ -179,8 +179,14 @@ public class APatientMiController {
         }
     }
 
-
-
+    @UserLoginToken
+    @PostMapping("/saveUpdatePatientId")
+    public R saveUpdatePatientId(@RequestBody APatientMi aPatientMi){
+        AssertUtil.isNotBlank(aPatientMi.getInpatientNo(),"住院号不能为空");
+        AssertUtil.isNotBlank(aPatientMi.getMzNo(),"门诊号不能为空");
+        aPatientMiService.saveUpdatePatientId(aPatientMi.getInpatientNo(),aPatientMi.getMzNo());
+        return R.ok();
+    }
 
 
     /**

+ 2 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/zy/APatientMiMapper.java

@@ -404,4 +404,6 @@ public interface APatientMiMapper {
     int updateMzPatientMiInpatientNo(APatientMi aPatientMi);
     @Select(" select *  from a_patient_mi where name =#{keyWard} or social_no=#{keyWard} or mz_no =#{keyWard} or home_tel =#{keyWard} ")
     List<APatientMi> selectByKeyWard(String keyWard);
+    @Update(" update a_patient_mi set mz_no = #{mzNo} where inpatient_no =#{inpatientNo} ")
+    int updateMzNoByInpatientNo(@Param("inpatientNo") String inpatientNo, @Param("mzNo") String mzNo);
 }

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/his/zy/APatientMiService.java

@@ -72,4 +72,13 @@ public interface APatientMiService {
      * @return: java.util.List<cn.hnthyy.thmz.entity.his.zy.APatientMi>
      **/
     List<APatientMi> queryByKeyWard(String keyWard);
+    /**
+     * @description: 修改门诊号
+     * @author: lihong
+     * @date: 2024/1/8 11:01
+     * @param: inpatientNo
+     * @param: mzNo
+     * @return: int
+     **/
+    int saveUpdatePatientId(String inpatientNo, String mzNo);
 }

+ 16 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zy/APatientMiServiceImpl.java

@@ -99,6 +99,7 @@ public class APatientMiServiceImpl implements APatientMiService {
     public List<APatientMi> queryByKeyWard(String keyWard) {
         List<APatientMi> aPatientMis = aPatientMiMapper.selectByKeyWard(keyWard);
         if(CollUtil.isNotEmpty(aPatientMis)){
+            aPatientMis.removeIf(item -> StrUtil.isNotBlank(item.getInpatientNo()) && item.getInpatientNo().startsWith("S"));
             Tools.trimCollectionStrField(aPatientMis);
             return aPatientMis;
         }else {
@@ -118,4 +119,19 @@ public class APatientMiServiceImpl implements APatientMiService {
         }
         return null;
     }
+
+    /**
+     * @param inpatientNo
+     * @param mzNo
+     * @description: 修改门诊号
+     * @author: lihong
+     * @date: 2024/1/8 11:01
+     * @param: inpatientNo
+     * @param: mzNo
+     * @return: int
+     */
+    @Override
+    public int saveUpdatePatientId(String inpatientNo, String mzNo) {
+        return aPatientMiMapper.updateMzNoByInpatientNo(inpatientNo, mzNo);
+    }
 }

+ 11 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zy/ZyActpatientServiceImpl.java

@@ -19,6 +19,7 @@ import cn.hnthyy.thmz.mapper.his.zy.PatientMiSfzMapper;
 import cn.hnthyy.thmz.mapper.his.yz.YzActOrderMapper;
 import cn.hnthyy.thmz.mapper.his.zy.*;
 import cn.hnthyy.thmz.service.his.mz.MzPatientMiService;
+import cn.hnthyy.thmz.service.his.zd.DictDataService;
 import cn.hnthyy.thmz.service.his.zy.ZyActpatientService;
 import cn.hnthyy.thmz.service.his.zy.ZyConfigService;
 import cn.hnthyy.thmz.service.his.zy.ZyDepositFileService;
@@ -599,6 +600,11 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
         if (CollUtil.isNotEmpty(inPatientNoList)) {
             for (String inPatientNo : inPatientNoList) {
                 if (zyActpatientMapper.selectCountByInpatientNo(inPatientNo) > 0) {
+                    ZyActpatient zyActpatient = zyActpatientMapper.selectByInpatientNo(ZyActpatient.ZY_ACTPATIENT, inPatientNo, null);
+                    //单病种可以开处方
+                    if(Constants.DBZ_CODE.equals(zyActpatient.getResponceType())){
+                        return false;
+                    }
                     return true;
                 }
             }
@@ -610,6 +616,11 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
                     for (APatientMi aPatientMi : aPatientMis) {
                         if (StrUtil.isNotBlank(aPatientMi.getInpatientNo())) {
                             if (zyActpatientMapper.selectCountByInpatientNo(aPatientMi.getInpatientNo()) > 0) {
+                                ZyActpatient zyActpatient = zyActpatientMapper.selectByInpatientNo(ZyActpatient.ZY_ACTPATIENT, aPatientMi.getInpatientNo(), null);
+                                //单病种可以开处方
+                                if(Constants.DBZ_CODE.equals(zyActpatient.getResponceType())){
+                                    return false;
+                                }
                                 return true;
                             }
                         }

+ 1 - 1
src/main/resources/static/js/jBox/common.js

@@ -97,7 +97,7 @@ function setCertificateData(result,zyFlag) {
     if(zyFlag == 1){
         queryUserInfoBySocialNo(1);
     }else if(zyFlag == 0){
-        queryApaientInfo(result.Certificate.IDNumber)
+        queryApaientInfo(result.Certificate.IDNumber,false)
     }else {
         queryUserInfoBySocialNo();
     }

+ 63 - 19
src/main/resources/static/js/zy/hospitalized.js

@@ -230,7 +230,7 @@ $(function () {
     $("#idCard").change(function (e) {
         let idCard = $("#idCard").val();
         if (idCard.length == 18) {
-            queryApaientInfo(idCard)
+            queryApaientInfo(idCard,false)
         }
     });
 
@@ -238,13 +238,13 @@ $(function () {
         // queryUserInfoByphoneNo();
         var phoneNo = $("#phoneNum").val();
         if (phoneNo.length == 11) {
-            queryApaientInfo(phoneNo)
+            queryApaientInfo(phoneNo,false)
         }
     });
 
     $("#userName").change(function (e) {
         var userName = $('#userName').val();
-        queryApaientInfo(userName)
+        queryApaientInfo(userName,false)
     });
 
 
@@ -401,7 +401,7 @@ function queryUserInfoByAdmissionNumber() {
     var admissionNumber = $("#admissionNumber").val();
     if ( admissionNumber.length >= 4) {
         $("#admissionNumber").attr("title", admissionNumber);
-        fillZyPatientInfo(admissionNumber)
+        fillZyPatientInfo(admissionNumber,false)
     }
 }
 
@@ -415,7 +415,7 @@ function queryUserInfoByCardNo() {
     var index = cardNo.indexOf("-");
     if (index > 0 && index == cardNo.length - 2) {
         $("#cardNo").attr("title", cardNo);
-        queryApaientInfo(cardNo)
+        queryApaientInfo(cardNo,true)
     }
 }
 
@@ -436,9 +436,10 @@ function cardNoChange() {
 
 /**
  * keyWard  查询内容
+ * updatePatientIdFlag  门诊号修改标识  true 不修改  false 或 不传其他修改
  * 查询住院病人档案信息
  */
-function queryApaientInfo(keyWard) {
+function queryApaientInfo(keyWard,updatePatientIdFlag) {
     if(!stringNotBlank(keyWard)){
         return
     }
@@ -452,9 +453,9 @@ function queryApaientInfo(keyWard) {
                 return;
             }
             if(res.code == 0 && res.data !=null && res.data.length > 1){
-                    fitZyPatient(res)
+                    fitZyPatient(res,updatePatientIdFlag)
             }else if(res.code == 0 && res.data !=null && res.data.length == 1) {
-                fillZyPatientInfo(res.data[0].inpatientNo)
+                fillZyPatientInfo(res.data[0].inpatientNo,updatePatientIdFlag)
             }else {
                 queryMzPatientInfo(keyWard)
             }
@@ -1211,9 +1212,9 @@ function queryPtientInfoBySocialNo() {
                 }
                 if (res.code == 0 ) {
                     if(res.data.length > 1){
-                        fitZyPatient(res,true,true)
+                        fitZyPatient(res)
                     }else if(res.data.length == 1) {
-                        fillZyPatientInfo(res.data[0].inpatientNo,true,true)
+                        fillZyPatientInfo(res.data[0].inpatientNo)
                     }else {
                         queryUserInfoBySocialNo()
                     }
@@ -1338,7 +1339,7 @@ function fillPatinet(patientId) {
  * @param checkFlag
  * @param infoFlag
  */
-function fillZyPatientInfo(patNo) {
+function fillZyPatientInfo(patNo,updatePatientIdFlag) {
     if(!stringNotBlank(patNo)){
         return
     }
@@ -1366,7 +1367,7 @@ function fillZyPatientInfo(patNo) {
                     initCity(4, cityCode);
                     initDistrict(4, cityCode, birthPlace);
                 }
-                if(stringNotBlank(res.data.mzNo)){
+                if(!updatePatientIdFlag){
                     $("#cardNo").val(res.data.mzNo);
                     $("#cardNo").blur();
                 }
@@ -1412,8 +1413,10 @@ function fillZyPatientInfo(patNo) {
                 $("#idCard").attr("title", res.data.socialNo);
                 $("#idCard").blur();
                 $("#admissionNumber").val(res.data.inpatientNo);
-                if (stringNotBlank(res.data.mzNo)) {
+                if (!updatePatientIdFlag) {
                     $("#patientId").val(res.data.mzNo);
+                }else {
+                    $("#patientId").val($("#cardNo").val())
                 }
                 if (res.data.provinceCode != null && res.data.provinceCode.length >= 6) {
                     $("#provinceCode").selectpicker('val', res.data.provinceCode);
@@ -1421,7 +1424,11 @@ function fillZyPatientInfo(patNo) {
                     initCity(1, res.data.cityCode);
                     initDistrict(1, res.data.cityCode, res.data.districtCode);
                 }
-                queryMzZyReq(res.data.mzNo)
+                if(updatePatientIdFlag){
+                    queryMzZyReq($("#cardNo").val())
+                }else {
+                    queryMzZyReq(res.data.mzNo)
+                }
                 checkZyPatient(patNo)
             }
         }
@@ -1434,10 +1441,9 @@ function fillZyPatientInfo(patNo) {
 /**
  * 多个住院号 显示住院档案信息
  * @param res
- * @param checkFlag
- * @param infoFlag
+ * @param updatePatientIdFlag
  */
-function fitZyPatient(res,checkFlag,infoFlag) {
+function fitZyPatient(res,updatePatientIdFlag) {
     if (res.data.length > 0) {
         $("#zyPatientModal").modal();
         $("#zyPatientTable").html(null);
@@ -1466,7 +1472,7 @@ function fitZyPatient(res,checkFlag,infoFlag) {
             }
             $("<tr data-target='" + res.data[i].inpatientNo + "'><td>" + res.data[i].inpatientNo + "</td><td>" + res.data[i].name + "</td><td>" + gender + "</td><td>" + icCardNo + "</td><td>" + phoneNo + "</td><td>" + birthDay + "</td><td>" + socialNo + "</td></tr>").appendTo("#zyPatientTable").bind('click', function () {
                 $("#zyPatientModal").modal("hide");
-                fillZyPatientInfo($(this).attr("data-target"));
+                fillZyPatientInfo($(this).attr("data-target"),updatePatientIdFlag);
             });
         }
     }
@@ -1617,7 +1623,7 @@ function siReadCard(params) {
                 $("#idCard").val(data.data.idNo);
                 $("#userName").val(data.data.userName);
                 // queryUserInfoBySocialNo();
-                queryApaientInfo(data.data.idNo)
+                queryApaientInfo(data.data.idNo,false)
                 //successMesage(res);
             } else {
                 errorMesage(res);
@@ -1763,4 +1769,42 @@ function uploadHkbFile() {
             console.log(res);
         }
     });
+}
+//代开修改门诊号窗口
+function openSeeUpdatePatientIdModal() {
+    $("#seeUpdatePatientIdModal").modal();
+    clearUpdatePatientIdModal()
+    if(stringNotBlank($("#admissionNumber").val())){
+        $("#pat_no_update").val($("#admissionNumber").val())
+    }
+}
+
+function clearUpdatePatientIdModal() {
+    $("#pat_no_update").val(null)
+    $("#mz_no_update").val(null)
+}
+
+
+//修改门诊号
+function saveUpdatePatientId() {
+ let param = {
+     inpatientNo:$("#pat_no_update").val(),
+     mzNo:$("#mz_no_update").val(),
+ }
+postAjaxJsonHttpRequst("/thmz/saveUpdatePatientId",param,true,function (res) {
+// 请求成功
+    if (res == '401' || res == 401) {
+        window.location.href = '/thmz/login/view'
+        return;
+    }
+    if (res.code == 0) {
+        clearUpdatePatientIdModal()
+        successMesage(res);
+        $("#seeUpdatePatientIdModal").modal('hide')
+    }else {
+        errorMesage(res);
+    }
+})
+
+
 }

+ 37 - 0
src/main/resources/templates/zy/hospitalized.html

@@ -64,6 +64,7 @@
                         <a id="hkbUploadFile"><i class="fa fa-arrow-up">&nbsp;户口本上传</i></a>
                         <a id="seeHkb"><i class="fa fa-eye">&nbsp;查看户口本</i></a>
                         <a id="seeIdCard"><i class="fa fa-eye">&nbsp;查看身份证</i></a>
+                        <a id="updateMzNo"><i class="fa fa-check-square-o" onclick="openSeeUpdatePatientIdModal()">&nbsp;修改门诊号</i></a>
                         <a id="updateInpatientNo"><i class="fa fa-check-square-o">&nbsp;修改住院号</i></a>
                         <a onclick="saveZyPatient(false)" id="saveUser" hidden><i
                                 class="fa fa-user">&nbsp;保存患者信息</i></a>
@@ -687,6 +688,42 @@
     </div>
 </div>
 
+<!--修改门诊号-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="seeUpdatePatientIdModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content" style="width: 600px;margin-left: 200px;">
+            <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 autocomplete="off">
+                    <div class="item form-group">
+                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="pat_no_update">住院号 <span
+                                class="required">*</span>
+                        </label>
+                        <div class="col-md-6 col-sm-6 col-xs-12">
+                            <input class="form-control col-md-7 col-xs-12" id="pat_no_update"/>
+                        </div>
+                    </div>
+                    <div class="item form-group">
+                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="mz_no_update">门诊号 <span
+                                class="required">*</span>
+                        </label>
+                        <div class="col-md-6 col-sm-6 col-xs-12">
+                            <input class="form-control col-md-7 col-xs-12" id="mz_no_update"/>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" id="updatePatientId" onclick="saveUpdatePatientId()">保存</button>
+                <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>