Browse Source

入院登记功能优化

hurugang 2 years ago
parent
commit
0dd5e03eb9

+ 29 - 6
src/main/java/cn/hnthyy/thmz/mapper/his/zy/APatientMiMapper.java

@@ -32,7 +32,8 @@ public interface APatientMiMapper {
             ",rtrim(insur2_code) insur2_code,lastvisit_date,lastadmiss_times,lastbill_acc,baddebit_acc,baddebit_date,rtrim(birth_place) birth_place,rtrim(country) country," +
             "rtrim(temp_district) temp_district,rtrim(fv_dept) fv_dept,fv_date,rtrim(hic_no) hic_no,rtrim(py_code) py_code,rtrim(cpy) cpy,rtrim(yb_card_no) yb_card_no," +
             "rtrim(mz_no) mz_no,rtrim(dnh) dnh,rtrim(account_street) account_street,rtrim(account_district) account_district,rtrim(account_zipcode) account_zipcode,rtrim(origin_type) origin_type" +
-            ",rtrim(card_iden) card_iden,rtrim(card_no) card_no,rtrim(indi_id) indi_id,rtrim(hic_no_new) hic_no_new,rtrim(health_card_no) health_card_no,rtrim(psn_cert_type) psn_cert_type from a_patient_mi where inpatient_no = #{inpatientNo}")
+            ",rtrim(card_iden) card_iden,rtrim(card_no) card_no,rtrim(indi_id) indi_id,rtrim(hic_no_new) hic_no_new,rtrim(health_card_no) health_card_no" +
+            ",rtrim(psn_cert_type) psn_cert_type,rtrim(province_code) province_code,rtrim(city_code) city_code,rtrim(district_code) district_code from a_patient_mi where inpatient_no = #{inpatientNo}")
     APatientMi selectPatientMiByInPatientNo(@Param("inpatientNo") String inpatientNo);
 
 
@@ -51,7 +52,8 @@ public interface APatientMiMapper {
             ",rtrim(insur2_code) insur2_code,lastvisit_date,lastadmiss_times,lastbill_acc,baddebit_acc,baddebit_date,rtrim(birth_place) birth_place,rtrim(country) country," +
             "rtrim(temp_district) temp_district,rtrim(fv_dept) fv_dept,fv_date,rtrim(hic_no) hic_no,rtrim(py_code) py_code,rtrim(cpy) cpy,rtrim(yb_card_no) yb_card_no," +
             "rtrim(mz_no) mz_no,rtrim(dnh) dnh,rtrim(account_street) account_street,rtrim(account_district) account_district,rtrim(account_zipcode) account_zipcode,rtrim(origin_type) origin_type" +
-            ",rtrim(card_iden) card_iden,rtrim(card_no) card_no,rtrim(indi_id) indi_id,rtrim(hic_no_new) hic_no_new,rtrim(health_card_no) health_card_no,rtrim(psn_cert_type) psn_cert_type from a_patient_mi where mz_no = #{mzNo}")
+            ",rtrim(card_iden) card_iden,rtrim(card_no) card_no,rtrim(indi_id) indi_id,rtrim(hic_no_new) hic_no_new,rtrim(health_card_no) health_card_no" +
+            ",rtrim(psn_cert_type) psn_cert_type,rtrim(province_code) province_code,rtrim(city_code) city_code,rtrim(district_code) district_code from a_patient_mi where mz_no = #{mzNo}")
     APatientMi selectAPatientByMzNo(@Param("mzNo") String mzNo);
 
 
@@ -68,7 +70,7 @@ public interface APatientMiMapper {
             "employer_zipcode, relation_name, relation_code, relation_street, relation_district, relation_tel, relation_zipcode, contract_code, insur1_code, " +
             "insur2_code, lastvisit_date, lastadmiss_times, lastbill_acc, baddebit_acc, baddebit_date, birth_place, country, temp_district, fv_dept, fv_date, " +
             "hic_no, py_code, cpy, yb_card_no, mz_no, dnh, account_street, account_district, account_zipcode, origin_type, card_iden, card_no, indi_id, hic_no_new," +
-            " health_card_no,psn_cert_type) " +
+            " health_card_no,psn_cert_type,province_code,city_code,district_code) " +
             "VALUES(#{inpatientNo,jdbcType=CHAR},#{outpatientNo,jdbcType=CHAR},#{name,jdbcType=CHAR},#{birthDate,jdbcType=TIMESTAMP},#{sex,jdbcType=CHAR},#{marryCode,jdbcType=CHAR}," +
             "#{nationCode,jdbcType=CHAR},#{occupationCode,jdbcType=CHAR},#{vipCode,jdbcType=CHAR},#{socialNo,jdbcType=VARCHAR},#{homeTel,jdbcType=CHAR}," +
             "#{homeStreet,jdbcType=CHAR},#{homeDistrict,jdbcType=CHAR},#{homeZipcode,jdbcType=CHAR},#{tempStreet,jdbcType=CHAR},#{tempTel,jdbcType=CHAR}," +
@@ -79,7 +81,8 @@ public interface APatientMiMapper {
             "#{baddebitDate,jdbcType=TIMESTAMP},#{birthPlace,jdbcType=CHAR},#{country,jdbcType=CHAR},#{tempDistrict,jdbcType=CHAR},#{fvDept,jdbcType=CHAR}," +
             "#{fvDate,jdbcType=TIMESTAMP},#{hicNo,jdbcType=CHAR},#{pyCode,jdbcType=CHAR},#{cpy,jdbcType=CHAR},#{ybCardNo,jdbcType=VARCHAR},#{mzNo,jdbcType=CHAR}," +
             "#{dnh,jdbcType=VARCHAR},#{accountStreet,jdbcType=VARCHAR},#{accountDistrict,jdbcType=VARCHAR},#{accountZipcode,jdbcType=CHAR},#{originType,jdbcType=CHAR}," +
-            "#{cardIden,jdbcType=CHAR},#{cardNo,jdbcType=VARCHAR},#{indiId,jdbcType=VARCHAR},#{hicNoNew,jdbcType=CHAR},#{healthCardNo,jdbcType=VARCHAR},#{psnCertType,jdbcType=VARCHAR}) ")
+            "#{cardIden,jdbcType=CHAR},#{cardNo,jdbcType=VARCHAR},#{indiId,jdbcType=VARCHAR},#{hicNoNew,jdbcType=CHAR},#{healthCardNo,jdbcType=VARCHAR}," +
+            "#{psnCertType,jdbcType=VARCHAR},#{provinceCode},#{cityCode},#{districtCode}) ")
     int insertMzPatientMi(APatientMi aPatientMi);
 
 
@@ -154,6 +157,15 @@ public interface APatientMiMapper {
             "<when test='psnCertType!=null'>",
             ",psn_cert_type =#{psnCertType,jdbcType=VARCHAR}",
             "</when>",
+            "<when test='provinceCode!=null'>",
+            ",province_code =#{provinceCode}",
+            "</when>",
+            "<when test='cityCode!=null'>",
+            ",city_code =#{cityCode}",
+            "</when>",
+            "<when test='districtCode!=null'>",
+            ",district_code =#{districtCode}",
+            "</when>",
             "</trim>"
             ,"</script>"})
     int updateMzPatientMiByMzno(APatientMi aPatientMi);
@@ -234,6 +246,15 @@ public interface APatientMiMapper {
             "<when test='psnCertType!=null'>",
             ",psn_cert_type =#{psnCertType,jdbcType=VARCHAR}",
             "</when>",
+            "<when test='provinceCode!=null'>",
+            ",province_code =#{provinceCode}",
+            "</when>",
+            "<when test='cityCode!=null'>",
+            ",city_code =#{cityCode}",
+            "</when>",
+            "<when test='districtCode!=null'>",
+            ",district_code =#{districtCode}",
+            "</when>",
             "</trim>"
             ,"</script>"})
     int updateMzPatientMiByInpatientNo(APatientMi aPatientMi);
@@ -263,11 +284,13 @@ public interface APatientMiMapper {
     @Insert("INSERT INTO a_patient_mi ( inpatient_no , outpatient_no , name , birth_date , sex , marry_code , nation_code , occupation_code , vip_code , social_no ," +
             " home_tel , home_street , home_district , home_zipcode , temp_street , temp_tel , temp_zipcode , employer_name , employer_street , employer_district , " +
             "employer_tel , employer_zipcode , relation_name , relation_code , relation_street , relation_district , relation_tel , relation_zipcode , contract_code , " +
-            "insur1_code , insur2_code , lastvisit_date , lastadmiss_times , lastbill_acc , baddebit_acc , baddebit_date , birth_place , country , temp_district , mz_no,psn_cert_type )" +
+            "insur1_code , insur2_code , lastvisit_date , lastadmiss_times , lastbill_acc , baddebit_acc , baddebit_date , birth_place , country , temp_district , mz_no," +
+            "psn_cert_type,province_code,city_code,district_code )" +
             " SELECT #{inpatientNo,jdbcType=CHAR} , #{inpatientNo,jdbcType=CHAR} , #{name} , birth_date , sex , marry_code , nation_code , occupation_code , vip_code , social_no , home_tel , home_street , " +
             "home_district , home_zipcode , temp_street , temp_tel , temp_zipcode , employer_name , employer_street , employer_district , employer_tel , employer_zipcode , " +
             "relation_name , relation_code , relation_street , relation_district , relation_tel , relation_zipcode , contract_code , insur1_code , insur2_code , " +
-            "lastvisit_date , #{lastadmissTimes} , lastbill_acc , baddebit_acc , baddebit_date , birth_place , country , temp_district , isnull ( #{mzNo} , mz_no ),psn_cert_type FROM a_patient_mi b " +
+            "lastvisit_date , #{lastadmissTimes} , lastbill_acc , baddebit_acc , baddebit_date , birth_place , country , temp_district , isnull ( #{mzNo} , mz_no )," +
+            "psn_cert_type,province_code,city_code,district_code FROM a_patient_mi b " +
             "WHERE b.inpatient_no =#{oldInpatientNo,jdbcType=CHAR} ")
     int insertFromOtherItem(APatientMi aPatientMi);
 }

+ 32 - 7
src/main/resources/static/js/jBox/common.js

@@ -481,7 +481,7 @@ function fitPatient(res) {
 
 /**
  * 初始化省份
- * @param type 1 挂号 2 挂号列表 3 医生工作台
+ * @param type 1 挂号 2 挂号列表 3 医生工作台  4 入院登记
  */
 function initProvince(type) {
     $.ajax({
@@ -494,7 +494,7 @@ function initProvince(type) {
                 window.location.href = '/thmz/login/view'
                 return;
             }
-            var html = '';
+            var html ='<option value="-1">—— 省 ——</option>';
             $.each(res.data, function (commentIndex, comment) {
                 html += '<option value="' + comment.code + '">' + comment.name + '</option>';
             });
@@ -541,6 +541,23 @@ function initProvince(type) {
                     size: 5
                 });
                 initCity(3, null);
+            } else if (type == 4) {
+                $('#provinceCode').empty();   //清空resText里面的所有内容
+                $('#provinceCode').html(html);
+                $('#provinceCode').selectpicker('refresh');
+                $('#provinceCode').selectpicker({
+                    dropuAuto: false,
+                    size: 5
+                });
+                initCity(1, null);
+                $('#provinceUpdateHome').empty();   //清空resText里面的所有内容
+                $('#provinceUpdateHome').html(html);
+                $('#provinceUpdateHome').selectpicker('refresh');
+                $('#provinceUpdateHome').selectpicker({
+                    dropuAuto: false,
+                    size: 5
+                });
+                initCity(4, null);
             }
 
         }
@@ -550,7 +567,7 @@ function initProvince(type) {
 
 /**
  * 初始化市
- * @param type 1 新增模块 2 修改模块 3 快速接诊
+ * @param type 1 新增模块 2 修改模块 3 快速接诊 4 入院登记
  * @param defaultCode 默认选中
  */
 function initCity(type, defaultCode) {
@@ -559,6 +576,8 @@ function initCity(type, defaultCode) {
         parentCode = $("#editUserProvinceCode").val();
     } else if (type == 3) {
         parentCode = $("#rapidAcceptsProvinceCode").val();
+    }else if (type == 4){
+        parentCode = $("#provinceUpdateHome").val();
     }
     $.ajax({
         type: "GET",
@@ -570,7 +589,7 @@ function initCity(type, defaultCode) {
                 window.location.href = '/thmz/login/view'
                 return;
             }
-            var html = '';
+            var html ='<option value="-1">—— 市 ——</option>';
             $.each(res.data, function (commentIndex, comment) {
                 html += '<option value="' + comment.code + '">' + comment.name + '</option>';
             });
@@ -579,6 +598,8 @@ function initCity(type, defaultCode) {
                 id = 'editCityCode';
             } else if (type == 3) {
                 id = 'rapidAcceptsCityCode';
+            }else if (type == 4){
+                id = 'cityUpdateHome';
             }
             $('#' + id).empty();   //清空resText里面的所有内容
             $('#' + id).html(html);
@@ -591,7 +612,7 @@ function initCity(type, defaultCode) {
                 $('#' + id).selectpicker('val', defaultCode);
                 $('#' + id).selectpicker('refresh');
             } else {
-                initDistrict(type, null, null);
+                initDistrict(type, defaultCode, null);
             }
         }
     });
@@ -599,7 +620,7 @@ function initCity(type, defaultCode) {
 
 /**
  * 初始化区县
- * @param type 1 新增模块 2 修改模块 3 快速接诊
+ * @param type 1 新增模块 2 修改模块 3 快速接诊 4 入院登记
  * @param defaultCityCode 因为需要联动加载,市区域的值
  * @param defaultCode 默认选中
  */
@@ -610,6 +631,8 @@ function initDistrict(type, defaultCityCode, defaultCode) {
             defaultCityCode = $("#editCityCode").val();
         } else if (type == 3) {
             defaultCityCode = $("#rapidAcceptsCityCode").val();
+        } else if (type == 4) {
+            defaultCityCode = $("#cityUpdateHome").val();
         }
     }
     $.ajax({
@@ -622,7 +645,7 @@ function initDistrict(type, defaultCityCode, defaultCode) {
                 window.location.href = '/thmz/login/view'
                 return;
             }
-            var html = '';
+            var html ='<option value="-1">—— 区 ——</option>';
             $.each(res.data, function (commentIndex, comment) {
                 html += '<option value="' + comment.code + '">' + comment.name + '</option>';
             });
@@ -631,6 +654,8 @@ function initDistrict(type, defaultCityCode, defaultCode) {
                 id = 'editUserDistrictCode';
             } else if (type == 3) {
                 id = 'rapidAcceptsDistrictCode';
+            } else if (type == 4) {
+                id = 'countyUpdateHome';
             }
             $('#' + id).empty();   //清空resText里面的所有内容
             $('#' + id).html(html);

+ 57 - 36
src/main/resources/static/js/zy/hospitalized.js

@@ -135,6 +135,8 @@ $(function () {
      */
     initListSelect();
 
+    //初始化省份
+    initProvince(4);
 
     //每隔三秒读一次身份证
     setInterval(function () {
@@ -408,7 +410,7 @@ function queryUserInfoByCardNo() {
                         $("#idCard").val(res.data.socialNo);
                         $("#idCard").attr("title", res.data.socialNo);
                         $("#idCard").blur();
-                        $("#address").val(res.data.address);
+                        $("#address").val(res.data.detail);
                         $("#address").blur();
                         $("#patientId").val(res.data.patientId);
                         $('#certificateType').selectpicker('val', res.data.certificateType);
@@ -417,6 +419,11 @@ function queryUserInfoByCardNo() {
                             $("#saveUser").show();
                             $("#clearRegistration").show();
                         }
+                        $('#provinceUpdateHome').selectpicker('val', res.data.provinceCode);
+                        $('#provinceUpdateHome').selectpicker('refresh');
+                        initCity(4, res.data.cityCode);
+                        initDistrict(4, res.data.cityCode, res.data.districtCode);
+
                         //根据病人门诊id查询病人的入院申请
                         $.ajax({
                             type: "GET",
@@ -463,8 +470,15 @@ function queryUserInfoByCardNo() {
                                     return;
                                 }
                                 if (resAp.code == 0) {
-                                    $("#bornAddress").selectpicker('val', resAp.data.birthPlace);
-                                    $("#bornAddress").selectpicker('refresh');
+                                    var birthPlace=resAp.data.birthPlace;
+                                    if(birthPlace!=null){
+                                        var provinceCode=birthPlace.slice(0,2)+"0000";
+                                        $("#provinceCode").selectpicker('val',provinceCode);
+                                        $("#provinceCode").selectpicker('refresh');
+                                        var cityCode=birthPlace.slice(0,4)+"00";
+                                        initCity(1, cityCode);
+                                        initDistrict(1, cityCode, birthPlace);
+                                    }
                                     $("#permanentAddress").val(resAp.data.accountStreet);
                                     $("#address").val(resAp.data.homeStreet);
                                     $("#unitAddress").val(resAp.data.employerStreet);
@@ -654,7 +668,7 @@ function initListSelect() {
     initReqDoctorSelect()
     initCountrySelect();
     initNationSelect();
-    initDistrictSelect();
+   // initDistrictSelect();
     initRelationSelect();
     initOccupationSelect();
     iniAdmissStatus();
@@ -823,33 +837,33 @@ function initNationSelect() {
 }
 
 
-/**
- * 省份列表初始化
- */
-function initDistrictSelect() {
-    //医生列表
-    $.ajax({
-        type: "GET",
-        url: '/thmz/getDistrict',
-        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;
-            }
-            var html = '';
-            $.each(res.data, function (commentIndex, comment) {
-                html += '<option value="' + comment.code + '">' + comment.name + '</option>';
-            });
-            $('#bornAddress').empty();
-            $('#bornAddress').html(html);
-            $('#bornAddress').selectpicker('destroy').selectpicker('refresh');
-            $('#bornAddress').selectpicker('val', '430000');
-            $('#bornAddress').selectpicker('refresh');
-        }
-    });
-}
+// /**
+//  * 省份列表初始化
+//  */
+// function initDistrictSelect() {
+//     //医生列表
+//     $.ajax({
+//         type: "GET",
+//         url: '/thmz/getDistrict',
+//         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;
+//             }
+//             var html = '';
+//             $.each(res.data, function (commentIndex, comment) {
+//                 html += '<option value="' + comment.code + '">' + comment.name + '</option>';
+//             });
+//             $('#bornAddress').empty();
+//             $('#bornAddress').html(html);
+//             $('#bornAddress').selectpicker('destroy').selectpicker('refresh');
+//             $('#bornAddress').selectpicker('val', '430000');
+//             $('#bornAddress').selectpicker('refresh');
+//         }
+//     });
+// }
 
 
 /**
@@ -951,8 +965,8 @@ function clearInput() {
     $('#nationality').selectpicker('destroy').selectpicker('refresh');
     $("#nation").selectpicker('val', 'HA');
     $('#nation').selectpicker('destroy').selectpicker('refresh');
-    $("#bornAddress").selectpicker('val', '430000');
-    $('#bornAddress').selectpicker('destroy').selectpicker('refresh');
+    // $("#bornAddress").selectpicker('val', '430000');
+    // $('#bornAddress').selectpicker('destroy').selectpicker('refresh');
     $("#permanentAddress").val(null);
     $("#idCard").val(null);
     $("#address").val(null);
@@ -1088,7 +1102,7 @@ function saveZyPatient(flag) {
             "occupationCode": $("#profession").val(),
             "country": $("#nationality").val(),
             "nationCode": $("#nation").val(),
-            "birthPlace": $("#bornAddress").val(),
+            "birthPlace": $("#districtCode").val(),
             "accountStreet": $("#permanentAddress").val(),
             "psnCertType": $("#certificateType").val(),
             "socialNo": $("#idCard").val(),
@@ -1099,7 +1113,10 @@ function saveZyPatient(flag) {
             "relationCode": $("#relationship").val(),
             "relationTel": $("#contractPhone").val(),
             "relationStreet": $("#contractAddress").val(),
-            "inpatientNoType": getIndex("regi_List_btn_group")
+            "inpatientNoType": getIndex("regi_List_btn_group"),
+            "provinceCode": $("#provinceUpdateHome").val(),
+            "cityCode": $("#cityUpdateHome").val(),
+            "districtCode": $("#countyUpdateHome").val()
         }),
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         success: function (res) {
@@ -1230,9 +1247,13 @@ function fillPatinet(patientId) {
                     $("#idCard").val(res.data.socialNo);
                     $("#idCard").attr("title", res.data.socialNo);
                     $("#idCard").blur();
-                    $("#address").val(res.data.address);
+                    $("#address").val(res.data.detail);
                     $("#address").blur();
                     $("#patientId").val(res.data.patientId);
+                    $('#provinceUpdateHome').selectpicker('val', res.data.provinceCode);
+                    $('#provinceUpdateHome').selectpicker('refresh');
+                    initCity(4, res.data.cityCode);
+                    initDistrict(4, res.data.cityCode, res.data.districtCode);
                     if (res.data.name != null && res.data.name != "") {
                         $("#saveUser").show();
                         $("#clearRegistration").show();

+ 7 - 7
src/main/resources/templates/zy/hospitalized.html

@@ -14,7 +14,7 @@
 <script src="/thmz/js/jBox/baseISSObject.js"></script>
 <script src="/thmz/js/jBox/baseISSOnline.js"></script>
 <script src="/thmz/js/jBox/common.js"></script>
-<script src="/thmz/js/common/distpicker.js"></script>
+<!--<script src="/thmz/js/common/distpicker.js"></script>-->
 <script src="/thmz/js/zy/hospitalized.js"></script>
 <title>入院登记</title>
 <style>
@@ -205,13 +205,13 @@
                     <!--</div>-->
                     <label class="col-sm-2 control-label" style="padding-left: 28px;padding-top: 10px">出生地址</label>
                     <div class="col-md-4 col-sm-4 col-xs-12">
-                        <select class="form-control" id="provinceUpdate"></select>
+                        <select class="form-control selectpicker show-tick" id="provinceCode" onchange="initCity(1,null)" data-live-search="true"></select>
                     </div>
                     <div class="col-md-3 col-sm-3 col-xs-12">
-                        <select class="form-control" id="cityUpdate"></select>
+                        <select class="form-control selectpicker show-tick" id="cityCode" onchange="initDistrict(1,null,null)" data-live-search="true"></select>
                     </div>
                     <div class="col-md-3 col-sm-3 col-xs-12">
-                        <select class="form-control" id="countyUpdate"></select>
+                        <select class="form-control selectpicker show-tick" id="districtCode" data-live-search="true"></select>
                     </div>
                 </div>
             </div>
@@ -256,13 +256,13 @@
                 <div class="col-md-6 col-sm-6 col-xs-12 item" data-toggle="distpicker" data-autoselect="3">
                     <label class="col-sm-2 control-label" style="padding-left: 28px;padding-top: 10px">家庭住址</label>
                     <div class="col-md-4 col-sm-4 col-xs-12">
-                        <select class="form-control" id="provinceUpdateHome"></select>
+                        <select class="form-control selectpicker show-tick" id="provinceUpdateHome" onchange="initCity(4,null)" data-live-search="true"></select>
                     </div>
                     <div class="col-md-3 col-sm-3 col-xs-12">
-                        <select class="form-control" id="cityUpdateHome"></select>
+                        <select class="form-control selectpicker show-tick" id="cityUpdateHome" onchange="initDistrict(4,null,null)" data-live-search="true"></select>
                     </div>
                     <div class="col-md-3 col-sm-3 col-xs-12">
-                        <select class="form-control" id="countyUpdateHome"></select>
+                        <select class="form-control selectpicker show-tick" id="countyUpdateHome" data-live-search="true"></select>
                     </div>
                 </div>
                 <div class="col-md-6 col-sm-6 col-xs-12 item">