浏览代码

检验检查效验优化

lihong 1 年之前
父节点
当前提交
95fdf0a996

+ 12 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -1252,7 +1252,6 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 throw new MzException("请完善既往史内容!");
             }
         }
-
         setFullMzPrescriptionVo(mzPrescriptionVo, true, true);
         MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(mzPrescriptionVo.getPatientId());
         if (mzPatientMi == null) {
@@ -2439,6 +2438,12 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     }
                     mzYjReq.setReqComment(mzPrescriptionVo.getMzBlRecord().getEmrChiefComplaint());
                     mzYjReq.setReqTzComment(reqTzComment);
+                    if(needVerify){
+                        List<String> errList = jcJyItemChargeService.checkJyJcGenderAndAge(2, mzYjReq.getOrderCode(), mzPrescriptionVo.getPatientId());
+                        if(CollUtil.isNotEmpty(errList)){
+                            throw new MzException(CollUtil.join(errList,";"));
+                        }
+                    }
                 } else {
                     JyZdItem jyZdItem = jyZdItemService.queryJyZdItemByCode(mzYjReq.getOrderCode());
                     if (jyZdItem == null) {
@@ -2447,6 +2452,12 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                     if (YesNoEnum.YES.code.equals(jyZdItem.getDelFlag()) || YesNoEnum.YES.code.equals(jyZdItem.getMzFlag())) {
                         throw new MzException("保存处方失败,检验项目【" + jyZdItem.getName() + "】已经停用,无法继续使用!");
                     }
+                    if(needVerify){
+                        List<String> errList = jcJyItemChargeService.checkJyJcGenderAndAge(1, mzYjReq.getOrderCode(), mzPrescriptionVo.getPatientId());
+                        if(CollUtil.isNotEmpty(errList)){
+                            throw new MzException(CollUtil.join(errList,";"));
+                        }
+                    }
                     mzYjReq.setOrderName(jyZdItem.getName());
                     mzYjReq.setGroupName(jyZdItem.getName());
                     mzYjReq.setReqType(ReqTypeEnum.JIAN_YAN.code);

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/JcJyItemChargeServiceImpl.java

@@ -526,10 +526,10 @@ public class JcJyItemChargeServiceImpl implements JcJyItemChargeService {
             }
             Integer age = mzPatientMi.getAgeForYear();
             if(age != null){
-                if(zdItem.getMinAgeRestriction() != null && age >= zdItem.getMinAgeRestriction() ){
+                if(zdItem.getMinAgeRestriction() != null && age < zdItem.getMinAgeRestriction() ){
                     errMsg.add(StrUtil.format("此项目编码{}({})开具的最小年龄为{}岁",zdItem.getCode(),zdItem.getName(),zdItem.getMinAgeRestriction()));
                 }
-                if(zdItem.getMaxAgeRestriction() != null && age <= zdItem.getMaxAgeRestriction() ){
+                if(zdItem.getMaxAgeRestriction() != null && age > zdItem.getMaxAgeRestriction() ){
                     errMsg.add(StrUtil.format("此项目编码{}({})开具的最大年龄为{}岁",zdItem.getCode(),zdItem.getName(),zdItem.getMaxAgeRestriction()));
                 }
             }