Explorar el Código

住院病人在院期间禁止门诊就诊

hurugang hace 2 años
padre
commit
b7ca66f647

+ 15 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/ClinicController.java

@@ -7,6 +7,7 @@ import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.mz.*;
 import cn.hnthyy.thmz.entity.his.zd.ZdUnitCode;
+import cn.hnthyy.thmz.entity.his.zy.APatientMi;
 import cn.hnthyy.thmz.entity.thmz.Clinic;
 import cn.hnthyy.thmz.entity.thmz.TurnToConsultation;
 import cn.hnthyy.thmz.entity.thmz.User;
@@ -16,6 +17,7 @@ import cn.hnthyy.thmz.enums.PayMarkEnum;
 import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.service.his.mz.*;
 import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
+import cn.hnthyy.thmz.service.his.zy.APatientMiService;
 import cn.hnthyy.thmz.service.his.zy.ZyActpatientService;
 import cn.hnthyy.thmz.service.thmz.*;
 import lombok.extern.slf4j.Slf4j;
@@ -66,6 +68,8 @@ public class ClinicController {
     private MzYjReqService mzYjReqService;
     @Autowired
     private UserDeptRelationService userDeptRelationService;
+    @Autowired
+    private APatientMiService aPatientMiService;
 
     /**
      * 叫号通知
@@ -127,6 +131,17 @@ public class ClinicController {
                 resultMap.put("message", "病人不存在");
                 return resultMap;
             }
+            if(StringUtils.isNotBlank(mzPatientMi.getSocialNo())){
+                APatientMi aPatientMi= aPatientMiService.queryAPatientBySocialNo(mzPatientMi.getSocialNo());
+                if(aPatientMi!=null && StringUtils.isNotBlank(aPatientMi.getInpatientNo())){
+                   int num= zyActpatientService.queryCountByInpatientNo(aPatientMi.getInpatientNo());
+                   if(num>0){
+                       resultMap.put("code", -1);
+                       resultMap.put("message", "当前患者正在我院住院治疗,无法继续在门诊就诊!");
+                       return resultMap;
+                   }
+                }
+            }
             User tokenUser = TokenUtil.getUser(httpServletRequest);
             if ("null".equals(serialNo)) {
                 serialNo = null;

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

@@ -57,6 +57,23 @@ public interface APatientMiMapper {
     APatientMi selectAPatientByMzNo(@Param("mzNo") String mzNo);
 
 
+    /**
+     * 根据身份证号码查询对应的住院病人信息
+     * @param socialNo
+     * @return
+     */
+    @Select("select rtrim(inpatient_no) inpatient_no,rtrim(outpatient_no) outpatient_no,rtrim(name) name,birth_date,rtrim(sex) sex,rtrim(marry_code) marry_code,rtrim(nation_code) nation_code," +
+            "rtrim(occupation_code) occupation_code,rtrim(vip_code) vip_code,rtrim(social_no) social_no,rtrim(home_tel) home_tel,rtrim(home_street) home_street,rtrim(home_district) home_district," +
+            "rtrim(home_zipcode) home_zipcode,rtrim(temp_street) temp_street,rtrim(temp_tel) temp_tel,rtrim(temp_zipcode) temp_zipcode,rtrim(employer_name) employer_name," +
+            "rtrim(employer_street) employer_street,rtrim(employer_district) employer_district,rtrim(employer_tel) employer_tel,rtrim(employer_zipcode) employer_zipcode," +
+            "rtrim(relation_name) relation_name,rtrim(relation_code) relation_code,rtrim(relation_street) relation_street,rtrim(relation_district) relation_district," +
+            "rtrim(relation_tel) relation_tel,rtrim(relation_zipcode) relation_zipcode,rtrim(contract_code) contract_code,rtrim(insur1_code) insur1_code" +
+            ",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,rtrim(province_code) province_code,rtrim(city_code) city_code,rtrim(district_code) district_code from a_patient_mi where social_no = #{socialNo}")
+    APatientMi selectAPatientBySocialNo(@Param("socialNo") String socialNo);
 
 
 

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

@@ -24,6 +24,12 @@ public interface APatientMiService {
      */
     APatientMi queryPatientMiByInPatientNo(String inpatientNo);
 
+    /**
+     * 根据身份证号码查询对应的住院病人信息
+     * @param socialNo
+     * @return
+     */
+    APatientMi queryAPatientBySocialNo(String socialNo);
 
     /**
      * 根据门诊号码查询对应的住院病人信息

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

@@ -31,6 +31,11 @@ public class APatientMiServiceImpl implements APatientMiService {
         return aPatientMiMapper.selectPatientMiByInPatientNo(inpatientNo);
     }
 
+    @Override
+    public APatientMi queryAPatientBySocialNo(String socialNo) {
+        return aPatientMiMapper.selectAPatientBySocialNo(socialNo);
+    }
+
     @Override
     public APatientMi queryAPatientByMzNo(String mzNo) {
         return aPatientMiMapper.selectAPatientByMzNo(mzNo);