Browse Source

增加住院号搜索

lihong 2 years ago
parent
commit
5e8a2d6c25

+ 18 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/MzPatientMiController.java

@@ -6,6 +6,7 @@ import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.mz.MzPatientMi;
 import cn.hnthyy.thmz.entity.his.mz.MzZyReq;
+import cn.hnthyy.thmz.entity.his.zy.APatientMi;
 import cn.hnthyy.thmz.entity.thmz.HybirdTest;
 import cn.hnthyy.thmz.entity.thmz.User;
 import cn.hnthyy.thmz.entity.thmz.fetchSpcSlwinfo;
@@ -14,8 +15,11 @@ import cn.hnthyy.thmz.enums.GenderEnum;
 import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.service.his.ResponceTypeService;
 import cn.hnthyy.thmz.service.his.mz.MzPatientMiService;
+import cn.hnthyy.thmz.service.his.zy.APatientMiService;
+import cn.hnthyy.thmz.service.his.zy.ZyActpatientService;
 import cn.hnthyy.thmz.service.thmz.HybirdTestService;
 import cn.hnthyy.thmz.service.thmz.TsmzService;
+import cn.hutool.core.util.IdcardUtil;
 import cn.hutool.core.util.StrUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -38,6 +42,10 @@ public class MzPatientMiController {
     private TsmzService tsmzService;
     @Autowired
     private HybirdTestService hybirdTestService;
+    @Autowired
+    private ZyActpatientService zyActpatientService;
+    @Autowired
+    private APatientMiService aPatientMiService;
 
     /**
      * 根据病人就诊卡号查询病人信息
@@ -55,6 +63,16 @@ public class MzPatientMiController {
                 resultMap.put("message", "就诊卡号不能为空");
                 return resultMap;
             }
+            int num = zyActpatientService.queryCountByInpatientNo(icCardNo);
+            if(num > 0){
+             //住院号
+                APatientMi aPatientMi = aPatientMiService.queryPatientMiByInPatientNo(icCardNo);
+                if(StrUtil.isNotBlank(aPatientMi.getMzNo())){
+                    icCardNo = aPatientMi.getMzNo();
+                }else if (StrUtil.isNotBlank(aPatientMi.getSocialNo()) && IdcardUtil.isValidCard(aPatientMi.getSocialNo())){
+                    icCardNo = aPatientMi.getSocialNo();
+                }
+            }
             resultMap.put("code", 0);
             resultMap.put("message", "查询病人信息成功");
             resultMap.put("data", mzPatientMiService.queryByIcCardNo(icCardNo));