فهرست منبع

把rate='neo4j'的诊断取出,和界面诊断参与lis,pacs推理

kongwz 6 سال پیش
والد
کامیت
3962f29ba2

+ 10 - 2
graph-web/src/main/java/org/diagbot/graphWeb/work/GraphCalculate.java

@@ -58,7 +58,7 @@ public class GraphCalculate {
             featureRate.setFeatureName(d.getKey());
             featureRate.setExtraProperty("");
             featureRate.setDesc(d.getValue());
-            featureRate.setRate("");
+            featureRate.setRate("neo4j");
             featureRates.add(featureRate);
         }
 
@@ -89,7 +89,15 @@ public class GraphCalculate {
         Neo4jAPI neo4jAPI = new Neo4jAPI(DriverManager.newDrive());
         String webDiag = searchData.getDiag();
         List<String> webDiagList = Arrays.asList(webDiag.split(",|,|、"));
-        List<String> bigdataDiagList = searchData.getPushDiags();
+        List<FeatureRate> bigdataDiagFeature = searchData.getPushDiags();
+        List<String> bigdataDiagList =new ArrayList<>();
+        if(bigdataDiagFeature.size()>0){
+            for (FeatureRate fe:bigdataDiagFeature) {
+                if("neo4j".equals(fe.getRate())){
+                    bigdataDiagList.add(fe.getFeatureName());
+                }
+            }
+        }
         for (String web: webDiagList ) {
                 for (int i=0;i<bigdataDiagList.size();i++ ) {
                     if(bigdataDiagList.get(i).equals(web)){

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

@@ -657,6 +657,8 @@ public class Neo4jAPI {
             query = "match (l)-[r:近义词]->(m)\n" +
                     "where l.name in  " + fildList + "\n" +
                     "return l.name as zi,type(r),m.name as fu";
+//            System.out.println("近义词语句:");
+//            System.out.println(query);
             result = session.run(query);
             while (result.hasNext()) {
                 Record record = result.next();
@@ -665,6 +667,7 @@ public class Neo4jAPI {
                 fildList.remove(c);
                 fildList.add(d);
             }
+//            System.out.println("参与计算的词:"+fildList);
             newList.addAll(fildList);
             int i = 0;
             while (newList.size() > 0) {
@@ -676,6 +679,8 @@ public class Neo4jAPI {
                         "match (n)-[r:诊断依据]->(m)\n" +
                         "where n.name= row\n" +
                         "return m.name as condition, count(distinct r)>=m.path as jundgement, labels(m)[0] as label";
+//                System.out.println("第"+i+"次查询:");
+//                System.out.println(query);
                 result = session.run(query);
                 newList.clear();
                 while (result.hasNext()) {
@@ -695,6 +700,8 @@ public class Neo4jAPI {
                     "where n.name=row\n" +
                     "with distinct m,r\n" +
                     "return m.name as name, labels(m)[0] as label,type(r) as relationType";
+//            System.out.println("查询确诊和拟诊:");
+//            System.out.println(query);
 
             result = session.run(query);
             while (result.hasNext()) {

+ 1 - 5
graph/src/main/resources/bolt.properties

@@ -56,11 +56,7 @@ searchWords=match(d) where d.name in fildList return distinct d.name as name
 #\u6839\u636E\u75BE\u75C5\u67E5\u627E\u76F8\u5E94\u7684Lis Pacs
 serchLisPacs=match (d:Disease)-[r1:\u63A8\u8350]->(m)\n \
 where d.name in diseaseNmae return distinct d.name as name,labels(m)[0] as lei,m.name as n
-#serchLisPacs=match (d:Disease)-[r1:\u63A8\u8350]->(m:LIS)-[r2:\u5C0F\u9879]->(l) \
-#where d.name in diseaseNmae return distinct d.name as name,labels(m)[0] as lei,m.name as n,l.name as lr \
-#union \
-#match (d:Disease)-[r1:\u63A8\u8350]->(m:PACS)-[r2:\u7ED3\u679C]->(l) \
-#where d.name in diseaseNmae return distinct d.name as name,labels(m)[0] as lei,m.name as n,l.name as lr
+
 #\u66F4\u65B0\u8BCA\u65AD\u4F9D\u636E\u7684path
 updateConditionPath=match (n:Condition)<-[:\u8BCA\u65AD\u4F9D\u636E]-(m) \n \
           with n,\n \