wangfeng 4 лет назад
Родитель
Сommit
c2617f1e48

+ 1 - 1
src/main/java/com/diagbot/facade/HighRiskFacade.java

@@ -38,7 +38,7 @@ public class HighRiskFacade {
         HighRiskNeoVO highRiskNeoVO = fillHighRiskNeo(wordCrfDTO);
         List<HighRiskNeoDTO> highRiskNeoDTOList = neoFacade.getHighRiskNeo(highRiskNeoVO);
         // 规则处理
-        highRiskProcess.process(highRiskNeoDTOList, res);
+        highRiskProcess.process(highRiskNeoDTOList, res,wordCrfDTO);
     }
 
 

+ 123 - 4
src/main/java/com/diagbot/process/HighRiskProcess.java

@@ -1,12 +1,22 @@
 package com.diagbot.process;
 
+import com.diagbot.biz.push.entity.Item;
+import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.HighRiskNeoDTO;
 import com.diagbot.dto.IndicationDTO;
+import com.diagbot.dto.NodeNeoDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.model.label.PacsLabel;
+import com.diagbot.util.CoreUtil;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 高风险总入口
@@ -18,21 +28,130 @@ public class HighRiskProcess {
 
     /**
      * 处理业务
+     *
      * @param highRiskNeoDTOList
      * @param res
      */
-    public void process(List<HighRiskNeoDTO> highRiskNeoDTOList, IndicationDTO res) {
+    public void process(List<HighRiskNeoDTO> highRiskNeoDTOList, IndicationDTO res, WordCrfDTO wordCrfDTO) {
         for (HighRiskNeoDTO highRiskNeoDTO : highRiskNeoDTOList) {
             BillMsg billMsg = new BillMsg();
             String type = highRiskNeoDTO.getType();
-            billMsg.setMsg(highRiskNeoDTO.getName()
-                    + (StringUtil.isNotBlank(highRiskNeoDTO.getForm()) ? highRiskNeoDTO.getForm() : "")  // 药品剂型
-                    + "为高风险" + type + ",请留意");
+            billMsg.setMsg(highRiskNeoDTO.getName() + "为高风险" + type + ",请留意");
             billMsg.setOrderName(highRiskNeoDTO.getName());
             billMsg.setOrderStandName(highRiskNeoDTO.getStandname());
             billMsg.setType(type);
             res.getHighRiskList().add(billMsg);
             System.out.println(highRiskNeoDTO);
         }
+
+        proceSurgery(highRiskNeoDTOList, res, wordCrfDTO);
+    }
+
+    public void proceSurgery(List<HighRiskNeoDTO> highRiskNeoDTOList, IndicationDTO res, WordCrfDTO wordCrfDTO) {
+        for (HighRiskNeoDTO highRiskNeoDTO : highRiskNeoDTOList) {
+
+            String type = highRiskNeoDTO.getType();
+            List<Item> diag = wordCrfDTO.getDiag();
+            List<Lis> lisList = wordCrfDTO.getLis();
+            PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
+            //diagLabel 诊断
+            if (type.equals("手术")) {
+                List<NodeNeoDTO> factor = highRiskNeoDTO.getFactor();
+                NodeNeoDTO nodeNeo = new NodeNeoDTO();
+                nodeNeo.setTermtype("诊断");
+                nodeNeo.setName("糖尿病");
+                factor.add(nodeNeo);
+                NodeNeoDTO nodeLis = new NodeNeoDTO();
+                nodeLis.setTermtype("化验");
+                nodeLis.setName("白细胞计数");
+                nodeLis.setMax(new BigDecimal(20));
+                nodeLis.setMin(new BigDecimal(10));
+                nodeLis.setValType(0);
+                factor.add(nodeLis);
+                NodeNeoDTO nodeLis1 = new NodeNeoDTO();
+                nodeLis1.setTermtype("化验");
+                nodeLis1.setName("红细胞压积");
+                nodeLis1.setVal("阳性");
+                factor.add(nodeLis1);
+
+                NodeNeoDTO nodePass = new NodeNeoDTO();
+                nodePass.setTermtype("辅检");
+                nodePass.setName("胸部CT");
+                nodePass.setVal("肺叶根治性切除标本");
+                factor.add(nodePass);
+                for (NodeNeoDTO nodeNeoDTO : factor) {
+                    if (nodeNeoDTO.getTermtype().equals("诊断")) {
+                        String name = nodeNeoDTO.getName();
+                        for (Item item : diag) {
+                            if (item.getName().equals(name)) {
+                                BillMsg billMsg = new BillMsg();
+                                billMsg.setMsg("高风险手术 :" + name + ",请留意");
+                                billMsg.setOrderName(highRiskNeoDTO.getName());
+                                billMsg.setOrderStandName(highRiskNeoDTO.getStandname());
+                                billMsg.setType(type);
+                                res.getHighRiskList().add(billMsg);
+                            }
+                        }
+                    } else if (nodeNeoDTO.getTermtype().equals("化验")) {
+                        boolean flag = false;
+                        for (Lis lis : lisList) {
+                            if (lis.getUniqueName().equals(nodeNeoDTO.getName())) {
+                                if (StringUtil.isNotBlank(lis.getOtherValue())) {
+                                    if (lis.getOtherValue().equals(nodeNeoDTO.getVal())) {
+                                        BillMsg billMsgz = new BillMsg();
+                                        billMsgz.setMsg("高风险手术 :" + lis.getName() + lis.getDetailName() + lis.getOtherValue() + ",请留意");
+                                        billMsgz.setOrderName(highRiskNeoDTO.getName());
+                                        billMsgz.setOrderStandName(highRiskNeoDTO.getStandname());
+                                        billMsgz.setType(type);
+                                        res.getHighRiskList().add(billMsgz);
+                                    }
+                                } else if (lis.getValue() != null) {
+                                    double value = lis.getValue();
+                                    flag = CoreUtil.compareNum(nodeNeoDTO, value);
+                                    if (flag) {
+                                        BillMsg billMsgss = new BillMsg();
+                                        //map.put("msg", lis.getName() + lis.getDetailName() + CoreUtil.subZeroAndDot(String.valueOf(lis.getValue())));
+                                        billMsgss.setMsg("高风险手术 :" + lis.getName() + lis.getDetailName() + CoreUtil.subZeroAndDot(String.valueOf(lis.getValue())) + ",请留意");
+                                        billMsgss.setOrderName(highRiskNeoDTO.getName());
+                                        billMsgss.setOrderStandName(highRiskNeoDTO.getStandname());
+                                        billMsgss.setType(type);
+                                        res.getHighRiskList().add(billMsgss);
+                                    }
+                                }
+                            }
+                        }
+                    } else if (nodeNeoDTO.getTermtype().equals("辅检")) {
+                        //辅助检查描述
+                        List<Item> pacsDescList = new ArrayList<>();
+                        pacsLabel.getPacsNewList().stream().filter(x -> ListUtil.isNotEmpty(x.getPacsResults()) || ListUtil.isNotEmpty(x.getDisease())).forEach(
+                                x -> {
+                                    List<String> pacsResults = x.getPacsResults().stream().map(pacr -> pacr.getStandName()).collect(Collectors.toList());
+                                    List<String> diseases = x.getDisease().stream().map(disease -> disease.getStandName()).collect(Collectors.toList());
+                                    pacsResults.addAll(diseases);
+                                    pacsResults.stream().forEach(z -> {
+                                        Item item = new Item();
+                                        item.setName(z);
+                                        item.setUniqueName(z);
+                                        pacsDescList.add(item);
+                                    });
+                                }
+                        );
+                        //辅检匹配结果
+                        for (Item item : pacsDescList) {
+                            if (item.getUniqueName().equals(nodeNeoDTO.getVal())) {
+                                BillMsg billMsgss = new BillMsg();
+                                billMsgss.setMsg("高风险手术 :" + item.getUniqueName() + ",请留意");
+                                billMsgss.setOrderName(highRiskNeoDTO.getName());
+                                billMsgss.setOrderStandName(highRiskNeoDTO.getStandname());
+                                billMsgss.setType(type);
+                                res.getHighRiskList().add(billMsgss);
+                            }
+                        }
+                    }
+                }
+
+            }
+            System.out.println(highRiskNeoDTO);
+        }
     }
 }