浏览代码

增加病人手机号码检索

hurugang 6 年之前
父节点
当前提交
b16c1742fc

+ 26 - 0
src/main/java/cn/hnthyy/thmz/controller/MzyReqrecController.java

@@ -190,6 +190,19 @@ public class MzyReqrecController {
                 mzyReqrec.setDoctorCode(null);
             }
             PageViewVo pageViewVo = new PageViewVo(mzyReqrecPageDto.getPageIndex(), mzyReqrecPageDto.getPageSize());
+            if(StringUtils.isNotBlank(mzyReqrecPageDto.getPhoneNo())){
+                List<MzPatientMi> mzPatientMis=mzPatientMiService.queryByPhoneNo(mzyReqrecPageDto.getPhoneNo());
+                if(mzPatientMis==null || mzPatientMis.size()==0){
+                    pageViewVo.setTotal(0);
+                    pageViewVo.setData(Collections.EMPTY_LIST);
+                    resultMap.put("code", 0);
+                    resultMap.put("message", "查询挂号信息成功");
+                    resultMap.put("pageViewVo", pageViewVo);
+                    return resultMap;
+                }
+                List<String> patientIds = mzPatientMis.stream().filter(u -> StringUtils.isNotBlank(u.getPatientId())).map(u -> u.getPatientId()).collect(Collectors.toList());
+                mzyReqrecPageDto.setPatientIds(patientIds);
+            }
             int total = mzyReqrecService.countMzyReqrec(mzyReqrecPageDto);
             pageViewVo.setTotal(total);
             pageViewVo.setData(getMzyReqrecVo(mzyReqrecService.queryMzyReqrecWithPage(mzyReqrecPageDto)));
@@ -233,6 +246,19 @@ public class MzyReqrecController {
             if(StringUtils.isBlank(mzyReqrec.getDoctorCode())){
                 mzyReqrec.setDoctorCode(null);
             }
+            if(StringUtils.isNotBlank(mzyReqrecPageDto.getPhoneNo())){
+                List<MzPatientMi> mzPatientMis=mzPatientMiService.queryByPhoneNo(mzyReqrecPageDto.getPhoneNo());
+                if(mzPatientMis==null || mzPatientMis.size()==0){
+                    resultMap.put("code", 0);
+                    resultMap.put("message", "查询挂号统计信息成功");
+                    resultMap.put("registrationNum", 0);
+                    resultMap.put("haveClinicalNum", 0);
+                    resultMap.put("backNoNum", 0);
+                    return resultMap;
+                }
+                List<String> patientIds = mzPatientMis.stream().filter(u -> StringUtils.isNotBlank(u.getPatientId())).map(u -> u.getPatientId()).collect(Collectors.toList());
+                mzyReqrecPageDto.setPatientIds(patientIds);
+            }
             mzyReqrec.setVisitedMark(YesNoEnum.NO.code);
             mzyReqrec.setCancelMark(YesNoEnum.NO.code);
             int registrationNum = mzyReqrecService.countMzyReqrec(mzyReqrecPageDto);

+ 11 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/MzPatientMiMapper.java

@@ -144,4 +144,15 @@ public interface MzPatientMiMapper {
             "</foreach>",
             "</script>"})
     List<MzPatientMi> selectByPatientIds(@Param("patientIds") List<String> patientIds);
+
+
+    /**
+     * 按照手机号查询病人信息
+     * @param phoneNo
+     * @return
+     */
+    @Select("select rtrim(social_no) social_no,rtrim(hic_no) hic_no,rtrim(name) name,rtrim(sex) sex,lv_date,rtrim(patient_id) patient_id,rtrim(p_bar_code) p_bar_code," +
+            "rtrim(baddebt_mark) baddebt_mark,rtrim(response_type) response_type,rtrim(charge_type) charge_type,times,rtrim(reqdel_mark) reqdel_mark,age,birth_day," +
+            "rtrim(ic_card_no) ic_card_no,rtrim(phone_no) phone_no,rtrim(adress) address,rtrim(yb_card_no) yb_card_no,first_date,rtrim(rel_name) rel_name,rtrim(contract_name) contract_name from mz_patient_mi  where  phone_no =#{phoneNo}")
+    List<MzPatientMi> selectByPhoneNo(@Param("phoneNo") String phoneNo);
 }

+ 12 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/MzyReqrecMapper.java

@@ -41,6 +41,12 @@ public interface MzyReqrecMapper {
      */
     @Select({"<script>",
             "select count(*) from mzy_reqrec  where times >0 ",
+            "<when test='patientIds!=null'>",
+            " and patient_id in ",
+            "<foreach item='item' index='index' collection='patientIds' open='(' separator=',' close=')'>",
+            "#{item}",
+            "</foreach>",
+            "</when>",
             "<when test='mzyReqrec.unitCode!=null'>",
             " and unit_code =#{mzyReqrec.unitCode,jdbcType=CHAR}",
             "</when>",
@@ -78,6 +84,12 @@ public interface MzyReqrecMapper {
             "rtrim(printer_id) printer_id,rtrim(print_flag) print_flag,rtrim(windows_no) windows_no,serial_no,rtrim(receipt_bill) receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,",
             "visit_doctor,visit_date,paymode,psordnum,agtordnum   FROM (SELECT ROW_NUMBER() OVER (ORDER BY mzy_reqrec_page.request_day desc) AS RowNumber,",
             "* from dbo.mzy_reqrec mzy_reqrec_page where times >0 ",
+            "<when test='patientIds!=null'>",
+            " and patient_id in ",
+            "<foreach item='item' index='index' collection='patientIds' open='(' separator=',' close=')'>",
+            "#{item}",
+            "</foreach>",
+            "</when>",
             "<when test='mzyReqrec.unitCode!=null'>",
             " and unit_code =#{mzyReqrec.unitCode,jdbcType=CHAR}",
             "</when>",

+ 5 - 0
src/main/java/cn/hnthyy/thmz/pageDto/MzyReqrecPageDto.java

@@ -4,6 +4,7 @@ import cn.hnthyy.thmz.entity.his.MzyReqrec;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 挂号信息页面展示对象和传参对象
@@ -25,4 +26,8 @@ public class MzyReqrecPageDto {
     private Date beginTime;
     //查询的结束时间
     private Date endTime;
+    //手机号码
+    private String phoneNo;
+    //病人编号ID集合 (小孩子可能会留大人的电话,大人也有可能有就诊信息)
+    private List<String> patientIds;
 }

+ 7 - 0
src/main/java/cn/hnthyy/thmz/service/his/MzPatientMiService.java

@@ -56,4 +56,11 @@ public interface MzPatientMiService {
      * @return
      */
     List<MzPatientMi> queryByPatientIds(List<String> patientIds);
+
+    /**
+     * 按照手机号查询病人信息
+     * @param phoneNo
+     * @return
+     */
+    List<MzPatientMi> queryByPhoneNo(String phoneNo);
 }

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/MzPatientMiServiceImpl.java

@@ -63,5 +63,10 @@ public class MzPatientMiServiceImpl implements MzPatientMiService {
         return mzPatientMiMapper.selectByPatientIds(patientIds);
     }
 
+    @Override
+    public List<MzPatientMi> queryByPhoneNo(String phoneNo) {
+        return mzPatientMiMapper.selectByPhoneNo(phoneNo);
+    }
+
 
 }

+ 11 - 5
src/main/resources/static/js/registration.js

@@ -1474,7 +1474,7 @@ function loadTableCount() {
                 "unitCode": $("#deptNoParam").val(),
                 "doctorCode": $("#doctorParam").val(),
                 "name": $("#userNameParam").val()
-            }, "beginTime": new Date(rePortRangeArr[0]), "endTime": new Date(rePortRangeArr[1])
+            }, "beginTime": new Date(rePortRangeArr[0]), "endTime": new Date(rePortRangeArr[1]),"phoneNo":$("#phoneParam").val()
         }),
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         success: function (res) {
@@ -1527,7 +1527,8 @@ function loadCardList() {
         "beginTime": new Date(rePortRangeArr[0]),
         "endTime": new Date(rePortRangeArr[1]),
         "pageSize": 8,
-        "pageIndex": pageIndex
+        "pageIndex": pageIndex,
+        "phoneNo":$("#phoneParam").val()
     });
     if (regiListBtnGroup == 1) {
         dataParams = JSON.stringify({
@@ -1541,7 +1542,8 @@ function loadCardList() {
             "beginTime": new Date(rePortRangeArr[0]),
             "endTime": new Date(rePortRangeArr[1]),
             "pageSize": 8,
-            "pageIndex": pageIndex
+            "pageIndex": pageIndex,
+            "phoneNo":$("#phoneParam").val()
         });
     } else if (regiListBtnGroup == 2) {
         dataParams = JSON.stringify({
@@ -1555,7 +1557,8 @@ function loadCardList() {
             "beginTime": new Date(rePortRangeArr[0]),
             "endTime": new Date(rePortRangeArr[1]),
             "pageSize": 8,
-            "pageIndex": pageIndex
+            "pageIndex": pageIndex,
+            "phoneNo":$("#phoneParam").val()
         });
     } else if (regiListBtnGroup == 3) {
         dataParams = JSON.stringify({
@@ -1568,7 +1571,8 @@ function loadCardList() {
             "beginTime": new Date(rePortRangeArr[0]),
             "endTime": new Date(rePortRangeArr[1]),
             "pageSize": 8,
-            "pageIndex": pageIndex
+            "pageIndex": pageIndex,
+            "phoneNo":$("#phoneParam").val()
         });
     }
     $.ajax({
@@ -1890,6 +1894,7 @@ function queryParams(params) {
         endTime: new Date(rePortRangeArr[1]),
         pageSize: params.limit,   //页面大小
         pageIndex: params.offset / params.limit,  //页码
+        phoneNo:$("#phoneParam").val()
     };
     if (regiListBtnGroup == 1) {
         temp = {
@@ -1992,6 +1997,7 @@ function clearParams() {
     $("#doctorParam").selectpicker('val', null);
     $("#deptNoParam").selectpicker('refresh');
     $("#userNameParam").val(null);
+    $("#phoneParam").val(null);
     $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
 }
 

+ 10 - 4
src/main/resources/templates/registration.html

@@ -64,7 +64,7 @@
                     </label>
                     <div class="col-md-8 col-sm-8 col-xs-12">
                         <input id="userName" class="form-control col-md-7 col-xs-12" data-validate-length-range="2,10"
-                               placeholder="姓名/卡号/手机号" required="required" type="text" data-placement="bottom-right">
+                               placeholder="姓名" required="required" type="text" data-placement="bottom-right">
                         <input type='text' class="form-control hide" id='userNameReadOnly' readonly/>
                     </div>
                 </div>
@@ -324,18 +324,24 @@
                     <div class="col-md-12 col-sm-12 col-xs-12">
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="deptNoParam">科室
                         </label>
-                        <div class="col-md-5 col-sm-5 col-xs-12">
+                        <div class="col-md-3 col-sm-3 col-xs-12">
                             <select class="form-control selectpicker show-tick" data-live-search="true" title="请选择"
                                     id="deptNoParam" onchange="initListDoctorSelect()">
                             </select>
                         </div>
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="doctorParam">医生
                         </label>
-                        <div class="col-md-5 col-sm-5 col-xs-12">
+                        <div class="col-md-3 col-sm-3 col-xs-12">
                             <select class="form-control selectpicker show-tick" data-live-search="true" title="请选择"
                                     id="doctorParam">
                             </select>
                         </div>
+                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="phoneParam">手机
+                        </label>
+                        <div class="col-md-3 col-sm-3 col-xs-12">
+                            <input id="phoneParam" class="form-control col-md-7 col-xs-12"
+                                   placeholder="手机" type="text">
+                        </div>
                     </div>
                 </div>
                 <div class="item form-group">
@@ -343,7 +349,7 @@
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="userNameParam">姓名 </label>
                         <div class="col-md-3 col-sm-3 col-xs-12">
                             <input id="userNameParam" class="form-control col-md-7 col-xs-12"
-                                   placeholder="姓名/卡号/手机号" type="text">
+                                   placeholder="姓名" type="text">
                         </div>
                         <!--<label class="control-label col-md-1 col-sm-1 col-xs-12" for="sourceParam">来源-->
                         <!--</label>-->