Browse Source

Merge remote-tracking branch 'origin/master'

MarkHuang 4 years ago
parent
commit
2e367f10de

+ 1 - 26
src/main/java/com/diagbot/facade/BillFacade.java

@@ -3,12 +3,10 @@ package com.diagbot.facade;
 import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.biz.push.entity.Pacs;
-import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.process.BillProcess;
-import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.BillNeoVO;
 import com.diagbot.vo.Drug;
@@ -17,8 +15,6 @@ import com.diagbot.vo.ItemExt;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -50,28 +46,7 @@ public class BillFacade {
         billProcess.process(billNeoDTOList, wordCrfDTO, res);
 
         // 结果去重处理
-        dealMsg(res);
-    }
-
-
-    /**
-     * 提示信息去重
-     * @param indicationDTO
-     */
-    public void dealMsg(IndicationDTO indicationDTO) {
-        List<BillMsg> billMsgList = indicationDTO.getBillMsgList();
-        if (ListUtil.isNotEmpty(billMsgList)) {
-            List<String> msgList = new ArrayList<>();
-            Iterator<BillMsg> it = billMsgList.iterator();
-            while (it.hasNext()) {
-                String msg = it.next().getMsg();
-                if (msgList.contains(msg)) {
-                    it.remove();
-                } else {
-                    msgList.add(msg);
-                }
-            }
-        }
+        commonFacade.dealMsg(res.getBillMsgList());
     }
 
     public BillNeoVO fillBillNeo(WordCrfDTO wordCrfDTO) {

+ 50 - 0
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -3,6 +3,7 @@ package com.diagbot.facade;
 import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.client.CRFServiceClient;
+import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.enums.StandConvertEnum;
 import com.diagbot.model.ai.AIAnalyze;
@@ -32,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -448,6 +450,14 @@ public class CommonFacade {
                     pacsResList.add(itemModificationRe);
                 }
             }
+
+            // 辅检项目去重
+            if (ListUtil.isNotEmpty(pacsLabel.getRes())) {
+                dealMsgWithItem(pacsLabel.getRes());
+            }
+            if (ListUtil.isNotEmpty(pacsLabel.getItem())) {
+                dealMsgWithItem(pacsLabel.getItem());
+            }
         }
 
         //处理辅检
@@ -518,5 +528,45 @@ public class CommonFacade {
         lis.setUniqueName(uniqueName);
         return lis;
     }
+
+    /**
+     * 提示信息去重
+     *
+     * @param billMsgList
+     */
+    public void dealMsg(List<BillMsg> billMsgList) {
+        if (ListUtil.isNotEmpty(billMsgList)) {
+            List<String> msgList = new ArrayList<>();
+            Iterator<BillMsg> it = billMsgList.iterator();
+            while (it.hasNext()) {
+                String msg = it.next().getMsg();
+                if (msgList.contains(msg)) {
+                    it.remove();
+                } else {
+                    msgList.add(msg);
+                }
+            }
+        }
+    }
+
+    /**
+     * 提示信息去重
+     *
+     * @param itemList
+     */
+    public void dealMsgWithItem(List<Item> itemList) {
+        if (ListUtil.isNotEmpty(itemList)) {
+            List<String> msgList = new ArrayList<>();
+            Iterator<Item> it = itemList.iterator();
+            while (it.hasNext()) {
+                String msg = it.next().getName();
+                if (msgList.contains(msg)) {
+                    it.remove();
+                } else {
+                    msgList.add(msg);
+                }
+            }
+        }
+    }
 }
 

+ 3 - 0
src/main/java/com/diagbot/facade/HighRiskFacade.java

@@ -92,6 +92,9 @@ public class HighRiskFacade {
         // highRiskNeoDTOList.add(highRiskNeoDTO);
         // TODO 测试数据结束
         highRiskProcess.process(highRiskNeoDTOList, res,wordCrfDTO);
+
+        // 结果去重处理
+        // commonFacade.dealMsg(res.getHighRiskList());
     }
 
 

+ 1 - 0
src/main/java/com/diagbot/facade/IndicationFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.diagbot.client.StandConvertServiceClient;
+import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.exception.CommonErrorCode;

+ 33 - 17
src/main/java/com/diagbot/facade/TestFacade.java

@@ -738,29 +738,35 @@ public class TestFacade {
             //年龄
             String[] split = bean.getAgeAll().split(",");
             indicationPushVO.setAge((int) getValueNum(split));
+            indicationPushVO.setMsg("年龄");
             indicationPushVO.setRuleType("3");
             indicationPushVO.setIdNum(bean.getIdNum());
-            List<Item> operationOrder = new ArrayList<>();
+
             //体格
             String physique = bean.getPhysique();
             String[] physiqueStrArray = physique.split(",");
             for (String str : physiqueStrArray) {
+                IndicationPushVO indphysiquePushVO = new IndicationPushVO();
                 if (str.contains(",")) {
                     //包含英文逗号
                     String[] strArray = str.split(",");
                     String t = strArray[0] + getValue(strArray) + strArray[3];
-                    indicationPushVO.setVital(t);
-                    break;
+                    indphysiquePushVO.setVital(t);
+                    indphysiquePushVO.setMsg("体格"+t);
+                    indicationPushVOList.add(indicationPushVO);
                 } else {
-                    indicationPushVO.setVital(str);
-                    break;
+                    indphysiquePushVO.setVital(str);
+                    indphysiquePushVO.setMsg("体格"+str);
+                    indicationPushVOList.add(indicationPushVO);
                 }
             }
             //化验
             String lisAll = bean.getLisAll();
             String[] physiquelisAll = lisAll.split(",");
-            List<Lis> lisList = new ArrayList<>();
+
             for (String str : physiquelisAll) {
+                IndicationPushVO indicationPushVOlisList = new IndicationPushVO();
+                List<Lis> lisList = new ArrayList<>();
                 if (str.contains(",")) {
                     //包含英文逗号
                     String[] strArray = str.split(",");
@@ -771,41 +777,50 @@ public class TestFacade {
                     lisBean.setDetailName(strArray[0]);
                     lisBean.setValue(getValue(strArray));
                     lisList.add(lisBean);
-                    break;
+                    indicationPushVOlisList.setMsg("化验"+strArray[0]);
+                    indicationPushVOlisList.setLis(lisList);
+                    indicationPushVOList.add(indicationPushVOlisList);
                 }
             }
-            indicationPushVO.setLis(lisList);
+
             //辅检
             String pacsAll = bean.getPacsAll();
             String[] physiquepacsAll = pacsAll.split(",");
-            indicationPushVO.setSymptom("B超:提示" + pacsAll);
-            List<Pacs> pacs = new ArrayList<>();
+            indicationPushVO.setSymptom(pacsAll);
+
             for (String pacsStr : physiquepacsAll) {
+                IndicationPushVO indicationPushVOpacs = new IndicationPushVO();
+                List<Pacs> pacs = new ArrayList<>();
                 Pacs pacs1 = new Pacs();
                 pacs1.setUniqueName("腹部CT");
                 pacs1.setName("腹部CT");
                 pacs1.setResult(pacsStr);
                 pacs.add(pacs1);
-                break;
+                indicationPushVOpacs.setMsg("辅检"+pacsStr);
+                indicationPushVOpacs.setPacs(pacs);
+                indicationPushVOList.add(indicationPushVO);
             }
-            indicationPushVO.setPacs(pacs);
             //诊断"腹部CT"
             String disease = bean.getDisease();
             String[] physiquedisease = disease.split(",");
-            List<Item> diag = new ArrayList<>();
+
             for (String diseaseStr : physiquedisease) {
+                IndicationPushVO indicationPushVOpacs = new IndicationPushVO();
+                List<Item> diag = new ArrayList<>();
                 Item item = new Item();
                 item.setUniqueName(diseaseStr);
                 item.setName(diseaseStr);
                 diag.add(item);
-                break;
+                indicationPushVOpacs.setMsg("诊断"+diseaseStr);
+                indicationPushVOpacs.setDiag(diag);
+                indicationPushVOList.add(indicationPushVOpacs);
             }
-            indicationPushVO.setDiag(diag);
+            List<Item> operationOrder = new ArrayList<>();
             Item item = new Item();
             item.setUniqueName(bean.getOperationName());
             item.setName(bean.getOperationName());
             operationOrder.add(item);
-            indicationPushVO.setOperationOrder(operationOrder);
+            //indicationPushVO.setOperationOrder(operationOrder);
             indicationPushVOList.add(indicationPushVO);
         }
 
@@ -816,7 +831,8 @@ public class TestFacade {
             try {
                 IndicationDTO indicationDTO = indicationFacade.indicationFac(indicationPushVO);
                 if (ListUtil.isEmpty(indicationDTO.getHighRiskList())) {
-                    msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配");
+                    msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配"+indicationPushVO.getMsg());
+
                 }
             } catch (Exception e) {
                 System.out.println(e.getMessage());

+ 9 - 62
src/main/java/com/diagbot/process/HighRiskProcess.java

@@ -11,14 +11,11 @@ import com.diagbot.enums.TypeEnum;
 import com.diagbot.model.label.PacsLabel;
 import com.diagbot.model.label.VitalLabel;
 import com.diagbot.rule.CommonRule;
-import com.diagbot.util.CoreUtil;
-import com.diagbot.util.MsgUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 
 /**
  * @Description: 高风险总入口
@@ -39,77 +36,27 @@ public class HighRiskProcess {
      */
     public void process(List<HighRiskNeoDTO> highRiskNeoDTOList, IndicationDTO res, WordCrfDTO wordCrfDTO) {
         List<BillMsg> highRiskList = new ArrayList<>();
+        CommonRule commonRule = new CommonRule();
         for (HighRiskNeoDTO highRiskNeoDTO : highRiskNeoDTOList) {
             System.out.println(highRiskNeoDTO);
             String type = highRiskNeoDTO.getType();
-            if (highRiskNeoDTO.getIsHighrisk()==true) {
+            if (highRiskNeoDTO.getIsHighrisk() == true) {
                 commonRule.highRisk(highRiskNeoDTO, highRiskList);
             } else {
-
-                List<Item> diag = wordCrfDTO.getDiag();
-                List<Lis> lisList = wordCrfDTO.getLis();
-                PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
-                VitalLabel vitalLabel = wordCrfDTO.getVitalLabel();
-                Integer age1 = wordCrfDTO.getAge();
                 // 复杂情况高危手术
                 if (TypeEnum.operation.getName().equals(type)) {
                     List<NodeNeoDTO> factor = highRiskNeoDTO.getFactor();
                     for (NodeNeoDTO nodeNeoDTO : factor) {
                         if (TypeEnum.disease.getName().equals(nodeNeoDTO.getTermtype())) {
-                            /*String name = nodeNeoDTO.getName();
-                            for (Item item : diag) {
-                                if (item.getUniqueName().equals(name)) {
-                                    BillMsg billMsg = MsgUtil.getComplexOperationMsg( item.getName(), highRiskNeoDTO.getName(),nodeNeoDTO.getTermtype());
-                                    res.getHighRiskList().add(billMsg);
-                                }
-                            }*/
-                            BillMsg billMsg = MsgUtil.getComplexOperationMsg( nodeNeoDTO.getVal(), highRiskNeoDTO.getName(),nodeNeoDTO.getTermtype());
-                            highRiskList.add(billMsg);
+                            commonRule.highRiskComplex(nodeNeoDTO, highRiskList, highRiskNeoDTO);
                         } else if (TypeEnum.lis.getName().equals(nodeNeoDTO.getTermtype())) {
-                            /*for (Lis lis : lisList) {
-                                if (lis.getUniqueName().equals(nodeNeoDTO.getName())) {
-                                    Map<String, Object> map = CoreUtil.compareLis(nodeNeoDTO, lis);
-                                    if ((Boolean) map.get("flag") == true) {
-                                        BillMsg billMsg = MsgUtil.getComplexOperationMsg((String)map.get("msg"), highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
-                                        res.getHighRiskList().add(billMsg);
-                                    }
-                                }
-                            }*/
-                            BillMsg billMsg = MsgUtil.getComplexOperationMsg( nodeNeoDTO.getVal(), highRiskNeoDTO.getName(),nodeNeoDTO.getTermtype());
-                            highRiskList.add(billMsg);
+                            commonRule.highRiskComplex(nodeNeoDTO, highRiskList, highRiskNeoDTO);
                         } else if (TypeEnum.pacs.getName().equals(nodeNeoDTO.getTermtype())) {
-                            /*List<Item> pacsDescList = pacsLabel.getRes();
-                            //辅检匹配结果
-                            for (Item item : pacsDescList) {
-                                if (item.getUniqueName().equals(nodeNeoDTO.getVal())) {
-                                    BillMsg billMsg = MsgUtil.getComplexOperationMsg(item.getName(), highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
-                                    res.getHighRiskList().add(billMsg);
-                                }
-                            }*/
-                            BillMsg billMsg = MsgUtil.getComplexOperationMsg( nodeNeoDTO.getVal(), highRiskNeoDTO.getName(),nodeNeoDTO.getTermtype());
-                            highRiskList.add(billMsg);
-                        } else if (TypeEnum.vital.getName().equals(nodeNeoDTO.getTermtype())){
-                            /*Map<String, Object> map = CoreUtil.compareVital(nodeNeoDTO, vitalLabel);
-                            if ((Boolean) map.get("flag") == true) {
-                                BillMsg commonBillMsg = MsgUtil.getComplexOperationMsg((String)map.get("msg"),highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
-                                res.getHighRiskList().add(commonBillMsg);
-                            }
-*/
-                            BillMsg billMsg = MsgUtil.getComplexOperationMsg( nodeNeoDTO.getVal(), highRiskNeoDTO.getName(),nodeNeoDTO.getTermtype());
-                            highRiskList.add(billMsg);
-                        }else if(TypeEnum.age.getName().equals(nodeNeoDTO.getTermtype())){
-                            /*Boolean flag = false;
-                            if(nodeNeoDTO != null && wordCrfDTO.getAge() != null) {
-                                Integer age = wordCrfDTO.getAge();
-                                flag = CoreUtil.compareNum(nodeNeoDTO, age);
-                            }
-                            if (flag) {
-                                String message = "年龄" + wordCrfDTO.getAge();
-                                BillMsg billMsg = MsgUtil.getComplexOperationMsg(message, highRiskNeoDTO.getName(), nodeNeoDTO.getTermtype());
-                                res.getHighRiskList().add(billMsg);
-                            }*/
-                            BillMsg billMsg = MsgUtil.getComplexOperationMsg( nodeNeoDTO.getVal(), highRiskNeoDTO.getName(),nodeNeoDTO.getTermtype());
-                            highRiskList.add(billMsg);
+                            commonRule.highRiskComplex(nodeNeoDTO, highRiskList, highRiskNeoDTO);
+                        } else if (TypeEnum.vital.getName().equals(nodeNeoDTO.getTermtype())) {
+                            commonRule.highRiskComplex(nodeNeoDTO, highRiskList, highRiskNeoDTO);
+                        } else if (TypeEnum.age.getName().equals(nodeNeoDTO.getTermtype())) {
+                            commonRule.highRiskComplex(nodeNeoDTO, highRiskList, highRiskNeoDTO);
                         }
                     }
                 }

+ 9 - 0
src/main/java/com/diagbot/rule/CommonRule.java

@@ -182,4 +182,13 @@ public class CommonRule {
         highRiskList.add(billMsg);
     }
 
+    /**
+     * fa'zha
+     * @param highRiskNeoDTO
+     * @param highRiskList
+     */
+    public void highRiskComplex(NodeNeoDTO nodeNeoDTO, List<BillMsg> highRiskList,HighRiskNeoDTO highRiskNeoDTO) {
+        BillMsg billMsg = MsgUtil.getComplexOperationMsg( nodeNeoDTO.getVal(), highRiskNeoDTO.getName(),nodeNeoDTO.getTermtype());
+        highRiskList.add(billMsg);
+    }
 }

+ 3 - 0
src/main/java/com/diagbot/vo/IndicationPushVO.java

@@ -24,4 +24,7 @@ public class IndicationPushVO extends SearchData {
     List<String> ruleTypeList = new ArrayList<>();
     // 文件的行号,测试文件数据用
     private String idNum;
+
+    private String msg;
+
 }