|
@@ -821,7 +821,7 @@ public class Neo4jAPI {
|
|
|
int i = 1;
|
|
|
while (newList.size() > 0) {
|
|
|
query = propertiesUtil.getProperty("searchNewCondition").replace("newList", newList.toString()).replace("fildList", startList.toString());
|
|
|
- System.out.println("第" + i + "次查询conditon语句 \n" + query);
|
|
|
+ logger.info("第" + i + "次查询conditon语句 \n" + query);
|
|
|
i++;
|
|
|
result = session.run(query);
|
|
|
newList.clear();
|
|
@@ -835,7 +835,7 @@ public class Neo4jAPI {
|
|
|
}
|
|
|
//第三步查找确诊
|
|
|
query = propertiesUtil.getProperty("searchDis").replace("startList", startList.toString());
|
|
|
- System.out.println("查询确诊的语句 \n" + query);
|
|
|
+ logger.info("查询确诊的语句 \n" + query);
|
|
|
result = session.run(query);
|
|
|
while (result.hasNext()) {
|
|
|
Record record = result.next();
|
|
@@ -850,7 +850,6 @@ public class Neo4jAPI {
|
|
|
for (String qu : quezhen) {
|
|
|
Map<String, String> dis_res = new HashMap<>();
|
|
|
dis_res.put("确诊", "");
|
|
|
-// diseaseCondition.put(qu, JSON.toJSONString(dis_res));
|
|
|
diseaseCondition.put(qu, dis_res);
|
|
|
logger.info("图谱推出的诊断为: " + qu);
|
|
|
}
|
|
@@ -859,6 +858,7 @@ public class Neo4jAPI {
|
|
|
String[] webDiagSplits = webDiag.split(",");
|
|
|
String mainDiag = webDiagSplits[0];
|
|
|
query = propertiesUtil.getProperty("searchDifferentialDiagnose").replace("mainDis", mainDiag);
|
|
|
+ logger.info("查找鉴别诊断,语句为:\n"+query);
|
|
|
result = session.run(query);
|
|
|
while (result.hasNext()) {
|
|
|
Record record = result.next();
|
|
@@ -984,9 +984,8 @@ public class Neo4jAPI {
|
|
|
//查找指标推送
|
|
|
Set<String> indSet = new HashSet<>();
|
|
|
List<String> newList = new ArrayList<>();
|
|
|
+ List<String> startList = new ArrayList<>();
|
|
|
ArrayList<String> fildList = new ArrayList<>();
|
|
|
- //输出确诊集合
|
|
|
- Set<String> quezhen = new LinkedHashSet<>();
|
|
|
for (String fild : keys) {
|
|
|
fildList.add("\"" + fild.trim() + "\"");
|
|
|
}
|
|
@@ -996,44 +995,32 @@ public class Neo4jAPI {
|
|
|
String query = "";
|
|
|
try {
|
|
|
session = driver.session(AccessMode.WRITE);
|
|
|
- logger.info("session 为: " + session);
|
|
|
- query = propertiesUtil.getProperty("serchCollect").replace("fildList", fildList.toString());
|
|
|
- result = session.run(query);
|
|
|
+ //第一步查询输入的词所在number
|
|
|
+ query = propertiesUtil.getProperty("searchNumColl").replace("startList", fildList.toString());
|
|
|
+ logger.info("查找词所在的number \n" + query);
|
|
|
+ result=session.run(query);
|
|
|
while (result.hasNext()) {
|
|
|
- Record record = result.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();
|
|
|
- fildList.remove(fild);
|
|
|
- fildList.add(js);
|
|
|
- }
|
|
|
- }
|
|
|
+ Record next = result.next();
|
|
|
+ String v = next.get("v").toString();
|
|
|
+ startList.add(v);
|
|
|
}
|
|
|
- newList.addAll(fildList);
|
|
|
+ newList.addAll(startList);
|
|
|
int i = 0;
|
|
|
while (newList.size() > 0) {
|
|
|
+ query = propertiesUtil.getProperty("searchNewCondition").replace("newList", newList.toString()).replace("fildList", startList.toString());
|
|
|
+ logger.info("第" + i + "次查询conditon语句 \n" + query);
|
|
|
i++;
|
|
|
- query = propertiesUtil.getProperty("searchCondition").replace("newList", newList.toString()).replace("fildList", fildList.toString());
|
|
|
result = session.run(query);
|
|
|
newList.clear();
|
|
|
while (result.hasNext()) {
|
|
|
Record record = result.next();
|
|
|
String condition = record.get("condition").toString();
|
|
|
- String jundgement = record.get("jundgement").toString();
|
|
|
- String label = record.get("label").toString();
|
|
|
- if ("TRUE".equals(jundgement)) {
|
|
|
- newList.add(condition);
|
|
|
- fildList.add(condition);
|
|
|
- }
|
|
|
+ newList.add(condition);
|
|
|
+ startList.add(condition);
|
|
|
}
|
|
|
}
|
|
|
- query = propertiesUtil.getProperty("searchIndication").replace("fildList", fildList.toString());
|
|
|
+ query = propertiesUtil.getProperty("searchIndication").replace("fildList", startList.toString());
|
|
|
+ logger.info("查找可以推送的指标\n"+query);
|
|
|
result = session.run(query);
|
|
|
while (result.hasNext()) {
|
|
|
Record record = result.next();
|