소스 검색

Merge remote-tracking branch 'origin/push-dev' into push-grade-rule

louhr 5 년 전
부모
커밋
04f00537f3

+ 1 - 1
common-push/src/main/java/org/diagbot/common/push/cache/CacheFileManager.java

@@ -24,7 +24,7 @@ public class CacheFileManager {
 
     private String user = "root";
     private String password = "lantone";
-    private String url = "jdbc:mysql://192.168.2.241:3306/med?useUnicode=true&characterEncoding=UTF-8";
+    private String url = "jdbc:mysql://192.168.2.121:3306/med?useUnicode=true&characterEncoding=UTF-8";
 
     private String path = "";
 

+ 46 - 6
graph-web/src/main/java/org/diagbot/graphWeb/work/GraphCalculate.java

@@ -154,16 +154,56 @@ public class GraphCalculate {
         String pacsOrder = searchData.getPacsOrder();
         //指标推送
         if (featureTypeList.contains("22") ) {
-            List<MedicalIndication> pacsMi = getPacsMi(pacsOrder, inputList,webDiag);
+            List<MedicalIndication> idns =new ArrayList<>();
+//            List<MedicalIndication> pacsMi = getPacsMi(pacsOrder, inputList,webDiag);
+            Set<String> newindSet = new HashSet<>();
+            Set<String> newindSet1 = new HashSet<>();
             //查找指标
             Set<String> indSet = neo4jAPI.getInd((String[]) inputList.toArray(new String[inputList.size()]));
-            logger.info("featureTypeList 包含22,走指标推送!!!,图谱推出的指标为:" + indSet);
             if(indSet.contains("肾功能不全")){
-                List<MedicalIndication> idn = neo4jAPI.getIdn(indSet, age, sex);
-                pacsMi.addAll(idn);
-                responseData.setMedicalIndications(pacsMi);
+                for (String ind:indSet
+                     ) {
+                    if("肾功能不全".equals(ind)){
+                        newindSet.add(ind);
+                    }else {
+                        newindSet1.add(ind);
+                    }
+                }
+            }
+            Map<String, String> indLiang =null;
+            if(newindSet1 != null && newindSet1.size()>0){
+                indLiang =neo4jAPI.getIndLiang(newindSet1);
+
+            }
+            logger.info("featureTypeList 包含22,走指标推送!!!,图谱推出的指标为:" + indSet);
+            List<MedicalIndication> idn =null;
+            if(newindSet.contains("肾功能不全")){
+                idn = neo4jAPI.getIdn(newindSet, age, sex);
+                if(idn!= null && idn.size()>0){
+                    idns.addAll(idn);
+                }
+            }
+            if(newindSet1 != null && newindSet1.size()>0){
+                for (String ind:newindSet1
+                     ) {
+                    MedicalIndication medicalIndication= new MedicalIndication();
+                    medicalIndication.setName(ind);
+                    List<MedicalIndicationDetail> ds = new ArrayList<>();
+                    MedicalIndicationDetail medicalIndicationDetail = new MedicalIndicationDetail();
+                    medicalIndicationDetail.setType(1);
+                    JSONObject jsonObject = new JSONObject();
+                    if(indLiang != null){
+                        jsonObject.put("name",indLiang.get(ind)); 
+                    }
+                    
+                    medicalIndicationDetail.setContent(jsonObject);
+                    ds.add(medicalIndicationDetail);
+                    medicalIndication.setDetails(ds);
+                    idns.add(medicalIndication);
+
+                }
             }
-            responseData.setMedicalIndications(pacsMi);
+            responseData.setMedicalIndications(idns);
 
         }
 

+ 3 - 3
graph-web/src/main/resources/url.properties

@@ -1,5 +1,5 @@
-highrisk.http.url=http://192.168.2.241:5004/knowledge/getHighRisk
-lisPacs.http.url=http://192.168.2.241:5004/knowledge/getLisPacs
-disease.http.url=http://192.168.2.241:5004/knowledge/getDisease
+highrisk.http.url=http://192.168.2.186:5004/knowledge/getHighRisk
+lisPacs.http.url=http://192.168.2.186:5004/knowledge/getLisPacs
+disease.http.url=http://192.168.2.186:5004/knowledge/getDisease
 #lisPacs.http.url=http://192.168.3.9:5004/knowledge/getLisPacs
 #highrisk.http.url=http://192.168.3.9:5004/knowledge/getHighRisk

+ 18 - 1
graph/src/main/java/org/diagbot/graph/jdbc/Neo4jAPI.java

@@ -1794,7 +1794,24 @@ public class Neo4jAPI {
         CloseSession(session);
         return medicalIndicationList;
     }
-
+   public Map<String,String> getIndLiang(Set<String> inds){
+       Map<String,String> kk = new HashMap<>();
+       String query = "";
+       Session session = null;
+       StatementResult result = null;
+       for (String ind:inds){
+           query = "match(i:Indicators)-[r:内容]->(c:Content) where i.name=\""+ind+"\" return c.name as name";
+           session = driver.session(AccessMode.WRITE);
+           result = session.run(query);
+           while (result.hasNext()) {
+               Record next1 = result.next();
+               String name = next1.get("name").toString();
+               kk.put(ind,name.replace("\"",""));
+           }
+       }
+       CloseSession(session);
+       return kk;
+   }
     public MangementEvaluation pushMe(String[] webDiagsplits, Map<String, Double> lis_Result) {
         MangementEvaluation mangementEvaluation = new MangementEvaluation();
         Map<String, JSONObject> mangementMap = new HashMap<>();

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

@@ -5,7 +5,7 @@ pass_235 = diagbot@20180822
 
 # neo4j bolt credentials
 #\u7EBF\u4E0A\u4F7F\u7528
-bolt.uri=bolt://192.168.2.232
+bolt.uri=bolt://192.168.2.233
 bolt.user=neo4j
 bolt.passwd=root
 

+ 2 - 2
graphdb/src/main/resources/application.yml

@@ -6,14 +6,14 @@ spring:
     active: local
   data:
     neo4j:
-      uri: bolt://192.168.2.232:7687
+      uri: bolt://192.168.2.233:7687
       username: neo4j
       password: root
 
 # 驱动配置信息
   datasource:
     driver-class-name: org.neo4j.jdbc.Driver
-    url: jdbc:neo4j:http://192.168.2.232:7474
+    url: jdbc:neo4j:http://192.168.2.233:7474
     username: neo4j
     password: root
     #定义初始连接数

+ 15 - 9
nlp/src/main/java/org/diagbot/nlp/relation/analyze/StructureAnalyze.java

@@ -430,6 +430,7 @@ public class StructureAnalyze {
                     break;
                 case Constants.word_property_diagnose:
                 case Constants.word_property_med:
+                case Constants.word_property_med_com:
                 case Constants.word_property_treat:
                     current = updateClinicalInfo(outputInfo, lexeme.getText(), lexeme.getProperty());
                     updated = true;
@@ -603,12 +604,12 @@ public class StructureAnalyze {
                 Cause cause = new Cause();
                 cause.setCauseName(name);
 
-//                if (current instanceof Symptom) {
-//                    symptom = (Symptom)current;
-//                }
-//                else {
+                if (current instanceof Symptom) {
+                    symptom = (Symptom)current;
+                }
+                else {
                     symptom = outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1);
-//                }
+                }
 
                 if (symptom.getCause() != null) {
                     if (!outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).getSymptomName().equals(symptom.getSymptomName())) {
@@ -635,10 +636,14 @@ public class StructureAnalyze {
 //                    symptom = outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1);
                 }
 
-                else if (symptom.getDegree() != null) {
-                    if (!outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).getSymptomName().equals(symptom.getSymptomName())) {
-                        outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).setSymptomName(symptom.getSymptomName());
-                        symptom = outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1);
+                else if (current instanceof Symptom) {
+                    symptom = (Symptom)current;
+
+                    if (symptom.getDegree() != null) {
+                        if (!outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).getSymptomName().equals(symptom.getSymptomName())) {
+                            outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).setSymptomName(symptom.getSymptomName());
+                            symptom = outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1);
+                        }
                     }
                     symptom.setDegree(degree);
 
@@ -698,6 +703,7 @@ public class StructureAnalyze {
                 }
                 break;
             case Constants.word_property_med:
+            case Constants.word_property_med_com:
                 if (current_treat instanceof Past || current instanceof Past) {
                     if (current_treat instanceof Past) {
                         past = (Past) current_treat;

+ 3 - 3
push-web/src/main/resources/static/dist/js/push.js

@@ -1,6 +1,6 @@
-var nlp_web_url = "http://192.168.2.241:5002/nlp-web";
-var bigdata_web_url = "http://192.168.2.241:5001/bigdata-web";
-var graph_web_url = "http://192.168.2.241:5003/graph-web";
+var nlp_web_url = "http://192.168.2.186:5002/nlp-web";
+var bigdata_web_url = "http://192.168.2.186:5001/bigdata-web";
+var graph_web_url = "http://192.168.2.186:5003/graph-web";
 // var push_web_url = "http://192.168.2.234:5008/push-web";
 
 // var nlp_web_url = "http://192.168.3.180:5002/nlp-web";