|
@@ -793,7 +793,8 @@ public class Neo4jAPI {
|
|
|
* @return
|
|
|
*/
|
|
|
public Map<String, Map<String, String>> getNewCondition(String[] keys, String webDiag) {
|
|
|
- Map<String, Map<String, String>> diseaseCondition = new LinkedHashMap<>();
|
|
|
+// Map<String, Map<String, String>> diseaseCondition = new LinkedHashMap<>();
|
|
|
+ Map<String,Map<String,String>> neoPushMap = new HashMap<>();
|
|
|
List<String> newList = new ArrayList<>();
|
|
|
List<String> fildList = new ArrayList<>();
|
|
|
List<String> startList = new ArrayList<>();
|
|
@@ -834,6 +835,7 @@ public class Neo4jAPI {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ String que="";
|
|
|
//第三步查找确诊
|
|
|
query = propertiesUtil.getProperty("searchDis").replace("startList", startList.toString());
|
|
|
logger.info("查询确诊的语句 \n" + query);
|
|
@@ -842,19 +844,88 @@ public class Neo4jAPI {
|
|
|
Record record = result.next();
|
|
|
String quezhenName = record.get("name").toString().replace("\"", "");
|
|
|
String conditionType = record.get("relationType").toString().replace("\"", "");
|
|
|
- if ("确诊".equals(conditionType)) {
|
|
|
- quezhen.add(quezhenName);
|
|
|
- } else if ("拟诊".equals(conditionType)) {
|
|
|
- quezhen.add(quezhenName);
|
|
|
+ if("拟诊".equals(conditionType) || "确诊".equals(conditionType)){
|
|
|
+ que = "确诊";
|
|
|
+ }else {
|
|
|
+ que = conditionType;
|
|
|
+ }
|
|
|
+ Map<String, String> queMap = neoPushMap.get(quezhenName);
|
|
|
+ if(queMap != null){
|
|
|
+ queMap.put(que, "");
|
|
|
+ neoPushMap.put(quezhenName,queMap);
|
|
|
+ }else {
|
|
|
+ Map<String,String> newMap = new HashMap<>();
|
|
|
+ newMap.put(que,"");
|
|
|
+ neoPushMap.put(quezhenName,newMap);
|
|
|
+ }
|
|
|
+// if ("确诊".equals(conditionType)) {
|
|
|
+// quezhen.add(quezhenName);
|
|
|
+// } else if ("拟诊".equals(conditionType)) {
|
|
|
+// quezhen.add(quezhenName);
|
|
|
+// }
|
|
|
+ }
|
|
|
+// for (String qu : quezhen) {
|
|
|
+// Map<String, String> dis_res = new HashMap<>();
|
|
|
+// dis_res.put("确诊", "");
|
|
|
+// diseaseCondition.put(qu, dis_res);
|
|
|
+// logger.info("图谱推出的诊断为: " + qu);
|
|
|
+// }
|
|
|
+
|
|
|
+ Map<String,Map<String,String>> queHighMap = new HashMap<>();
|
|
|
+ Map<String,Map<String,String>> highMap = new HashMap<>();
|
|
|
+ Map<String,Map<String,String>> quezhenMap = new HashMap<>();
|
|
|
+ for (Map.Entry<String,Map<String,String>> l:neoPushMap.entrySet()) {
|
|
|
+ String dis = l.getKey();
|
|
|
+ Set<String> typeSet = l.getValue().keySet();
|
|
|
+ if(typeSet.size() == 2 && typeSet.contains("确诊") && typeSet.contains("警惕")){
|
|
|
+ queHighMap.put(dis,new HashMap<>());
|
|
|
+ }
|
|
|
+ if(typeSet.size() == 1 && typeSet.contains("确诊")){
|
|
|
+ quezhenMap.put(dis,new HashMap<>());
|
|
|
+ }
|
|
|
+ if(typeSet.size() == 1 && typeSet.contains("警惕")){
|
|
|
+ highMap.put(dis,new HashMap<>());
|
|
|
}
|
|
|
}
|
|
|
- for (String qu : quezhen) {
|
|
|
- Map<String, String> dis_res = new HashMap<>();
|
|
|
- dis_res.put("确诊", "");
|
|
|
- diseaseCondition.put(qu, dis_res);
|
|
|
- logger.info("图谱推出的诊断为: " + qu);
|
|
|
+ if(queHighMap != null && queHighMap.size()>0){
|
|
|
+ Set<String> queHighSet = queHighMap.keySet();
|
|
|
+ for (String dis:queHighSet) {
|
|
|
+ Map<String,String> k = new HashMap<>();
|
|
|
+ k.put("确诊","");
|
|
|
+ k.put("警惕","");
|
|
|
+ neoPushMap.put(dis,k);
|
|
|
+ }
|
|
|
+ if(quezhenMap != null && quezhenMap.size()>0){
|
|
|
+ Set<String> queDis = quezhenMap.keySet();
|
|
|
+ for (String dis:queDis) {
|
|
|
+ Map<String,String> k = new HashMap<>();
|
|
|
+ k.put("确诊","");
|
|
|
+ neoPushMap.put(dis,k);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(quezhenMap != null && quezhenMap.size()>0){
|
|
|
+ Set<String> queDis = quezhenMap.keySet();
|
|
|
+ for (String dis:queDis) {
|
|
|
+ Map<String,String> k = new HashMap<>();
|
|
|
+ k.put("确诊","");
|
|
|
+ neoPushMap.put(dis,k);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(highMap != null && highMap.size()>0){
|
|
|
+ Set<String> highSet = highMap.keySet();
|
|
|
+ for (String dis:highSet) {
|
|
|
+ Map<String,String> k = new HashMap<>();
|
|
|
+ k.put("警惕","");
|
|
|
+ neoPushMap.put(dis,k);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- Set<String> queSets = diseaseCondition.keySet();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Set<String> queSets = neoPushMap.keySet();
|
|
|
if (webDiag != null && webDiag.trim() != "") {
|
|
|
String[] webDiagSplits = webDiag.split(",");
|
|
|
String mainDiag = webDiagSplits[0];
|
|
@@ -867,21 +938,21 @@ public class Neo4jAPI {
|
|
|
if (coll != null && coll.size() > 0) {
|
|
|
for (Object o : coll) {
|
|
|
if (queSets.contains(o.toString().replace("\"", ""))) {
|
|
|
- Map<String, String> stringStringMap = diseaseCondition.get(o.toString().replace("\"", ""));
|
|
|
+ Map<String, String> stringStringMap = neoPushMap.get(o.toString().replace("\"", ""));
|
|
|
stringStringMap.put("鉴别诊断", "");
|
|
|
- diseaseCondition.put(o.toString().replace("\"", ""), stringStringMap);
|
|
|
+ neoPushMap.put(o.toString().replace("\"", ""), stringStringMap);
|
|
|
} else {
|
|
|
Map<String, String> diffMap = new HashMap<>();
|
|
|
diffMap.put("鉴别诊断", "");
|
|
|
- diseaseCondition.put(o.toString().replace("\"", ""), diffMap);
|
|
|
+ neoPushMap.put(o.toString().replace("\"", ""), diffMap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
List<String> newDis = new ArrayList<>();
|
|
|
- //判断急诊和警惕
|
|
|
- for (Map.Entry<String, Map<String, String>> fs:diseaseCondition.entrySet()) {
|
|
|
+ //判断急诊
|
|
|
+ for (Map.Entry<String, Map<String, String>> fs:neoPushMap.entrySet()) {
|
|
|
String dis = fs.getKey();
|
|
|
Set<String> leiSet = fs.getValue().keySet();
|
|
|
if(leiSet.contains("确诊")){
|
|
@@ -895,22 +966,18 @@ public class Neo4jAPI {
|
|
|
Record record = result.next();
|
|
|
String emDis = record.get("emDis").toString();
|
|
|
int em = record.get("em").asInt();//急诊
|
|
|
- int hi = record.get("hi").asInt();//警惕
|
|
|
- Map<String, String> stringStringMap = diseaseCondition.get(emDis.replace("\"", ""));
|
|
|
+ Map<String, String> stringStringMap = neoPushMap.get(emDis.replace("\"", ""));
|
|
|
if(em == 1){
|
|
|
stringStringMap.put("急诊", "");
|
|
|
}
|
|
|
- if(hi == 1){
|
|
|
- stringStringMap.put("警惕", "");
|
|
|
- }
|
|
|
- diseaseCondition.put(emDis.replace("\"", ""), stringStringMap);
|
|
|
+ neoPushMap.put(emDis.replace("\"", ""), stringStringMap);
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
|
CloseSession(session);
|
|
|
- return diseaseCondition;
|
|
|
+ return neoPushMap;
|
|
|
}
|
|
|
}
|
|
|
|