|
@@ -754,6 +754,74 @@ public class Neo4jAPI {
|
|
|
return diseaseCondition;
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 不良反应推送
|
|
|
+ */
|
|
|
+ public Set<String> getUe(String[] keys) {
|
|
|
+ //查找不良反应推送
|
|
|
+ Set<String> indSet = new HashSet<>();
|
|
|
+ List<String> newList = new ArrayList<>();
|
|
|
+ ArrayList<String> fildList = new ArrayList<>();
|
|
|
+ for (String fild : keys) {
|
|
|
+ fildList.add("\"" + fild.trim() + "\"");
|
|
|
+ }
|
|
|
+ logger.info("根据 " + fildList + " 这些词推送不良反应!!!");
|
|
|
+ Session session = null;
|
|
|
+ StatementResult result = null;
|
|
|
+ String query = "";
|
|
|
+ try {
|
|
|
+ session = driver.session(AccessMode.WRITE);
|
|
|
+ logger.info("session 为: " + session);
|
|
|
+ query = propertiesUtil.getProperty("serchCollect").replace("fildList", fildList.toString());
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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();
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ query = propertiesUtil.getProperty("searchUe").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 {
|
|
|
+ CloseSession(session);
|
|
|
+ return indSet;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 指标推送
|
|
@@ -826,6 +894,7 @@ public class Neo4jAPI {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 新的诊断逻辑
|
|
|
* 包含确诊和疑诊集合
|
|
@@ -1092,7 +1161,7 @@ public class Neo4jAPI {
|
|
|
* @param filds // * @param sign 标志,2是平常诊断的治疗,0是复诊诊断的治疗,1是急诊
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String, Filnlly> getMulDiseaseTreat_2(String disease, Integer diseaseType, Set<String> disSet,Map<String, List<String>> disUE, String filds) {
|
|
|
+ public Map<String, Filnlly> getMulDiseaseTreat_2(String disease, Integer diseaseType, Set<String> disSet,Map<String, List<String>> disUE,Set<String> ueSet, String filds) {
|
|
|
Map<String, Filnlly> diagTreat = new HashMap<>();
|
|
|
Session session = null;
|
|
|
NumberFormat nf = NumberFormat.getPercentInstance();
|
|
@@ -1114,19 +1183,22 @@ public class Neo4jAPI {
|
|
|
for (String yizhen : disSet) {
|
|
|
fildsList.add("\'" + yizhen + "\'");
|
|
|
}
|
|
|
+ for (String h:ueSet) {
|
|
|
+ fildsList.add("\'" + h + "\'");
|
|
|
+ }
|
|
|
for (int j = 0; j < diseaseList.size(); j++) {
|
|
|
if (i != j) {
|
|
|
fildsList.add("\'" + diseaseList.get(j) + "\'");
|
|
|
}
|
|
|
}
|
|
|
- //获取每个病的不良反应集合
|
|
|
+ /* //获取每个病的不良反应集合
|
|
|
List<String> ueList = disUE.get(diseaseList.get(i));
|
|
|
if(ueList !=null && ueList.size()>0){
|
|
|
for (String ue:ueList) {
|
|
|
fildsList.add("\'"+ue+"\'");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+*/
|
|
|
diseFilds.put(diseaseList.get(i), fildsList);
|
|
|
}
|
|
|
try {
|
|
@@ -1300,15 +1372,14 @@ public class Neo4jAPI {
|
|
|
logger.info(diseaseName+"下面有"+stringList+"不良反应");
|
|
|
if(stringList !=null && stringList.size()>0){
|
|
|
List<Indicators> indicatorsList1 = new ArrayList<>();
|
|
|
- Indicators indicators1 = getAdverse(stringList, "低血糖反应");
|
|
|
+ Indicators indicators1 = getAdverse(ueSet, "低血糖反应");
|
|
|
logger.info(disSet + "包含 低血糖反应");
|
|
|
- Indicators indicators2 = getAdverse(stringList, "胃肠道不良反应");
|
|
|
+ Indicators indicators2 = getAdverse(ueSet, "胃肠道不良反应");
|
|
|
logger.info(disSet + "包含 胃肠道不良反应");
|
|
|
indicatorsList1.add(indicators1);
|
|
|
indicatorsList1.add(indicators2);
|
|
|
filnlly.setAdverseEvent(indicatorsList1);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
filnlly.setTreatment(drugsList);
|
|
|
diagTreat.put(diseaseName, filnlly);
|
|
@@ -1610,7 +1681,7 @@ public class Neo4jAPI {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public Indicators getAdverse(List<String> dis, String name) {
|
|
|
+ public Indicators getAdverse(Set<String> dis, String name) {
|
|
|
List<Detail> detailList1 = new ArrayList<>();
|
|
|
Indicators indicators1 = new Indicators();
|
|
|
indicators1.setName(name);
|