浏览代码

Merge remote-tracking branch 'origin/master'

louhr 6 年之前
父节点
当前提交
0e6e74e1c3

+ 1 - 3
graph-web/src/main/java/org/diagbot/graphWeb/work/GraphCalculate.java

@@ -52,7 +52,6 @@ public class GraphCalculate {
         Map<String, Map<String,String>> condition = neo4jAPI.getCondition((String[]) inputList.toArray(new String[inputList.size()]),webDiag );
         List<FeatureRate> featureRates = new ArrayList<>();
         for (Map.Entry<String, Map<String,String>> d : condition.entrySet()) {
-//            if (!"低血糖反应".equals(d.getKey()) && !"胃肠道不良反应".equals(d.getKey())) {
                 FeatureRate featureRate = new FeatureRate();
                 featureRate.setFeatureName(d.getKey());
                 featureRate.setExtraProperty("");
@@ -61,7 +60,6 @@ public class GraphCalculate {
                 featureRate.setDesc(s);
                 featureRate.setRate("neo4j");
                 featureRates.add(featureRate);
-//            }
         }
         Set<String> diseaseSet = condition.keySet();
         logger.info("diseaseSet :" + diseaseSet);
@@ -81,7 +79,7 @@ public class GraphCalculate {
         logger.info("页面导入的所有化验项为 :" +lisSet);
 
         //走治疗
-        if (webDiag.trim() != null && webDiag.trim() != "" && featureTypeList.contains("8")) {
+        if (webDiag !=null && webDiag.trim() != null && webDiag.trim() != "" && featureTypeList.contains("8")) {
             // 查找页面诊断里是否有不良反应
             String[] webDiagList = webDiag.split(",|,|、|;|:|;");
             Map<String, List<String>> disUE = neo4jAPI.getDisUE(webDiagList, diseaseType);

+ 0 - 10
graph/src/main/java/org/diagbot/graph/jdbc/Neo4jAPI.java

@@ -694,7 +694,6 @@ public class Neo4jAPI {
             newList.addAll(fildList);
             int i = 0;
             while (newList.size() > 0) {
-                i++;
                 query = propertiesUtil.getProperty("searchCondition").replace("newList", newList.toString()).replace("fildList", fildList.toString());
                 result = session.run(query);
                 newList.clear();
@@ -753,15 +752,6 @@ public class Neo4jAPI {
                     }
                 }
             }
-            //查找指标推送
-            Set<String> indSet = new HashSet<>();
-            query = propertiesUtil.getProperty("searchIndication").replace("fildList", fildList.toString());
-            result = session.run(query);
-            while (result.hasNext()) {
-                Record record = result.next();
-                String indName = record.get("name").toString().replace("\"", "");
-                indSet.add(indName);
-            }
         } catch (Exception e) {
             e.printStackTrace();
         } finally {

+ 15 - 3
graph/src/main/resources/bolt.properties

@@ -25,6 +25,11 @@ searchCollection=with fildList as data unwind data as row \n \
 match (n)-[r:\u5C5E\u4E8E]->(m)-[r1:\u7EC4\u5408]->(k) \n \
 where n.name= row \n \
 return m.name as condition, count(distinct r)>=m.path as jundgement, labels(m)[0] as label,k.name as standName
+
+searchCollection1=with fildList as data \n \
+match (n)-[r:\u5C5E\u4E8E]->(m)-[r1:\u7EC4\u5408]->(k) \n \
+where n.name in data \n \
+return m.name as condition, count(distinct r)>=m.path as jundgement, labels(m)[0] as label,k.name as standName
 #\u67E5\u627E\u8FD1\u4E49\u8BCD\u7CBE\u534E\u7248
 serchCollect=match (n)-[r:\u8BCA\u65AD\u4F9D\u636E|:\u8FD1\u4E49\u8BCD]->(e) where n.name in fildList return n.name as fild,collect(distinct type(r)) as typeCollect
 #\u67E5\u627E\u80FD\u63A8\u51FA\u8BCA\u65AD\u4F9D\u636E\u7684\u8BCD
@@ -35,10 +40,17 @@ with m,fildList as data unwind data as row\n \
 match (n)-[r:\u8BCA\u65AD\u4F9D\u636E]->(m)\n \
 where n.name= row\n \
 return m.name as condition, count(distinct r)>=m.path as jundgement, labels(m)[0] as label
+
+searchCondition1=with newList as data\n \
+match (l)-[r:\u8BCA\u65AD\u4F9D\u636E]->(m)\n \
+where l.name in data\n \
+with m,fildList as data1\n \
+match (n)-[r:\u8BCA\u65AD\u4F9D\u636E]->(m)\n \
+where n.name in data1\n \
+return m.name as condition, count(distinct r)>=m.path as jundgement, labels(m)[0] as label
 #\u67E5\u627E\u786E\u8BCA,\u62DF\u8BCA\u7684\u8BED\u53E5
-searchQuezhen=with fildList  as data unwind data as row\n \
-match (n)-[r:\u786E\u8BCA|:\u62DF\u8BCA]->(m:Disease)\n \
-where n.name=row\n \
+searchQuezhen=match (n)-[r:\u786E\u8BCA|:\u62DF\u8BCA]->(m:Disease)\n \
+where n.name in fildList\n \
 with distinct m,r\n \
 return m.name as name, labels(m)[0] as label,type(r) as relationType
 

+ 22 - 16
graphdb/src/main/java/org/diagbot/service/impl/KnowledgeServiceImpl.java

@@ -318,12 +318,14 @@ public class KnowledgeServiceImpl implements KnowledgeService {
             List<String> bigdataDiagList =new LinkedList<>();
             if(bigdataDiagFeature.size()>0){
                 for (FeatureRate fe:bigdataDiagFeature) {
-                    if("neo4j".equals(fe.getRate())){
-                        bigdataDiagList.add(fe.getFeatureName());
-                        logger.info("图谱推出的诊断为: "+fe.getFeatureName());
-                    }else {
-                        bigdataDiagList.add(fe.getFeatureName());
-                        logger.info("大数据推出的诊断为: "+fe.getFeatureName());
+                    if(!"{\"鉴别诊断\":\"\"}".equals(fe.getDesc())){
+                        if("neo4j".equals(fe.getRate())){
+                            bigdataDiagList.add(fe.getFeatureName());
+                            logger.info("图谱推出的诊断为: "+fe.getFeatureName());
+                        }else {
+                            bigdataDiagList.add(fe.getFeatureName());
+                            logger.info("大数据推出的诊断为: "+fe.getFeatureName());
+                        }
                     }
                 }
             }
@@ -361,7 +363,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
                     lis.addAll(bl);
                     pacs.addAll(bp);
                 }
-            }else {
+            }else if(biglisPacs !=null ) {
                 lis = biglisPacs.get("LIS");
                 pacs = biglisPacs.get("PACS");
                 logger.info("界面无诊断的情况下,推出诊断的lis为: "+lis);
@@ -371,16 +373,20 @@ public class KnowledgeServiceImpl implements KnowledgeService {
             logger.info("推出的合并pacs为: " + pacs);
             ArrayList<FeatureRate> lisFeature = new ArrayList<>();
             ArrayList<FeatureRate> pacsFeature = new ArrayList<>();
-            for (String l:lis) {
-                FeatureRate featureRate = new FeatureRate();
-                featureRate.setFeatureName(l);
-                lisFeature.add(featureRate);
-            }
-            for (String p:pacs) {
-                FeatureRate featureRate = new FeatureRate();
-                featureRate.setFeatureName(p);
-                pacsFeature.add(featureRate);
+            if(lis !=null && lis.size()>0){
+                for (String l:lis) {
+                    FeatureRate featureRate = new FeatureRate();
+                    featureRate.setFeatureName(l);
+                    lisFeature.add(featureRate);
+                }
             }
+           if(pacs !=null && pacs.size()>0){
+               for (String p:pacs) {
+                   FeatureRate featureRate = new FeatureRate();
+                   featureRate.setFeatureName(p);
+                   pacsFeature.add(featureRate);
+               }
+           }
             lisPacsFeature.put("lisList",lisFeature);
             lisPacsFeature.put("pacsList",pacsFeature);
 

+ 5 - 5
push-web/src/main/java/org/diagbot/push/controller/AlgorithmController.java

@@ -108,11 +108,11 @@ public class AlgorithmController extends BaseController {
         //推送管理评估
         bigDataResponseData.setManagementEvaluation(graphResponseData.getManagementEvaluation());
         //知识图谱直接替换大数据中的检验检查数据
-        graphResponseData = lisPacsCalculate.getLisPacs(request, searchData);
-//        if (!StringUtils.isEmpty(searchData.getDiag())) {
-        bigDataResponseData.setLabs(graphResponseData.getLabs());
-        bigDataResponseData.setPacs(graphResponseData.getPacs());
-//        }
+        if(searchData.getDiag() !=null || searchData.getPushDiags() != null){
+            graphResponseData = lisPacsCalculate.getLisPacs(request, searchData);
+            bigDataResponseData.setLabs(graphResponseData.getLabs());
+            bigDataResponseData.setPacs(graphResponseData.getPacs());
+        }
         response.setData(bigDataResponseData);
         return response;
     }