|
@@ -21,18 +21,28 @@ public class DiagnoseProcess {
|
|
|
//获取driver和session
|
|
|
Driver driver = DriverManager.newDrive("192.168.2.232","neo4j","root");
|
|
|
Session session = driver.session(AccessMode.READ);
|
|
|
- //第一步查找近义词.化验或辅检项目
|
|
|
- String searchJinyici = propertiesUtil.getProperty("searchJinyici");
|
|
|
- String fildList = searchJinyici.replace("fildList", startList.toString());
|
|
|
- query = fildList;
|
|
|
+ //第一步查找近义词
|
|
|
+// String searchJinyici = propertiesUtil.getProperty("searchJinyici");
|
|
|
+// String fildList = searchJinyici.replace("fildList", startList.toString());
|
|
|
+ query = propertiesUtil.getProperty("serchCollect").replace("fildList",startList.toString());;
|
|
|
// System.out.println("查找近义词语句:"+query+"\n");
|
|
|
run = session.run(query);
|
|
|
while (run.hasNext()){
|
|
|
- Record next = run.next();
|
|
|
- String c = next.get("zi").toString();
|
|
|
- String d = next.get("fu").toString();
|
|
|
- startList.remove(c);
|
|
|
- startList.add(d);
|
|
|
+ Record record = run.next();
|
|
|
+ String fild = record.get("fild").toString();
|
|
|
+ List<Object> typeCollect = record.get("typeCollect").asList();
|
|
|
+ //如果不包含诊断依据就找它的同义词,否则就要这个词
|
|
|
+ if("近义词".equals(typeCollect.get(0)) && typeCollect.size() ==1){
|
|
|
+ query = "match(l)-[r:近义词]->(h) where l.name="+fild+" return h.name as js";
|
|
|
+ StatementResult jinyiResult = session.run(query);
|
|
|
+ while (jinyiResult.hasNext()){
|
|
|
+ Record next = jinyiResult.next();
|
|
|
+ String js = next.get("js").toString();
|
|
|
+ startList.remove(fild);
|
|
|
+ startList.add(js);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
newList.addAll(startList);
|
|
|
int i =0;
|