Browse Source

流调增加前置校验

hurugang 4 years ago
parent
commit
69f1d99a53

+ 35 - 0
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -846,6 +846,41 @@ public class MedicalViewApiController {
     }
 
 
+
+
+    /**
+     * 新冠拦截手机挂号
+     *
+     * @return
+     */
+    @RequestMapping(value = "/covidManageForHaici", method = {RequestMethod.GET})
+    public Map<String, Object> covidManageForHaici(@RequestParam("patientId") String patientId, @RequestParam("unitCode") String unitCode) {
+        Map<String, Object> resultMap = new HashMap<>();
+        if (StringUtils.isBlank(patientId)) {
+            resultMap.put("code", -1);
+            resultMap.put("message", "查询当前病人流调失败,病人id为空");
+            return resultMap;
+        }
+        if (StringUtils.isBlank(unitCode)) {
+            resultMap.put("code", -1);
+            resultMap.put("message", "查询当前病人流调失败,科室编码为空");
+            return resultMap;
+        }
+        try {
+            mzyReqrecService.covidManageForHaici(patientId,unitCode);
+            resultMap.put("code", 0);
+            resultMap.put("message", "当前病人已经通过流调");
+            return resultMap;
+        } catch (Exception e) {
+            log.error("系统异常,请联系管理员");
+            resultMap.put("code", -1);
+            resultMap.put("message", e.getMessage());
+            return resultMap;
+        }
+    }
+
+
+
     /**
      * 根据门诊科室分类码查询科室列表
      *

+ 8 - 0
src/main/java/cn/hnthyy/thmz/service/his/MzyReqrecService.java

@@ -107,4 +107,12 @@ public interface MzyReqrecService {
      * @return true 减免  false 不减免
      */
     boolean notPayGhFee(String unitCode, Date requestDayD, String ampm);
+
+    /**
+     * 新冠拦截手机挂号
+     * @param patientId
+     * @param unitCode
+     * @throws MzException
+     */
+    void covidManageForHaici(String patientId, String unitCode) throws MzException;
 }

+ 33 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/MzyReqrecServiceImpl.java

@@ -178,6 +178,39 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         }
     }
 
+
+
+
+    /**
+     * 新冠拦截手机挂号
+     * @param patientId
+     * @param unitCode
+     * @throws MzException
+     */
+    @Override
+    public void covidManageForHaici(String patientId, String unitCode) throws MzException {
+        // 除了儿科与急诊科外都需要做新冠调查
+        if(!notCovid.contains(unitCode)){
+            MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(patientId);
+            if (mzPatientMi == null) {
+                throw new MzException("当前挂号的病人信息不存在,请先保存病人信息!");
+            }
+            CovidPojo covidPojo = covidPojoMapper.selectLastCovidPojoByIdcard(mzPatientMi.getSocialNo(), mzPatientMi.getPatientId());
+            if (covidPojo == null) {
+                haiCiAdapterService.commonMessageNotice(mzPatientMi.getIcCardNo(),"{\"data\":{\"first\":{\"color\":\"#FF0000\",\"value\":\"很抱歉,您的暂时无法进行挂号,详情如下:\"},\"keyword1\":{\"color\":\"#173177\",\"value\":\"\"},\"keyword2\":{\"color\":\"#173177\",\"value\":\"挂号失败\"},\"keyword2\":{\"color\":\"#173177\",\"value\":\"\"},\"keyword3\":{\"color\":\"#173177\",\"value\":\"您还未做新型冠状病毒感染流行病学史问卷,请前往填写\"},\"remark\":{\"color\":\"#FF0000\",\"value\":\"\"}},\"miniprogram\":{\"appid\":\"\",\"pagepath\":\"\"},\"template_id\":\"PEDh0niCG93uQsY5P6XS-J3haoB8sn4Pq-ZSrEZ6gGo\",\"touser\":\"\",\"url\":\""+lxbdcwjUrl+patientId+"\"}",new Date());
+                throw new MzException("当前挂号的病人还未做新型冠状病毒感染流行病学史问卷,请告知病人及时前往填写!");
+            }
+            boolean temperature =false;
+            if(covidPojo.getTemperature()==2){
+                BigDecimal feverNumber = new BigDecimal(covidPojo.getFeverNumber());
+                temperature= feverNumber.compareTo(BigDecimal.valueOf(37.3)) >= 0;
+            }
+            if (temperature|| covidPojo.getItem1() != 14 || covidPojo.getItem2() != 24 || covidPojo.getItem3() != 32 || covidPojo.getItem4() != 42 || covidPojo.getItem5() != 52) {
+                throw new MzException("当前病人新型冠状病毒感染流行病学史问卷未通过,请挂发热门诊并告知病人");
+            }
+        }
+    }
+
     /**
      * 发送号表剩余号数预警消息
      *