|
@@ -794,6 +794,7 @@ public class Neo4jAPI {
|
|
|
*/
|
|
|
public Map<String, Map<String, String>> getNewCondition(String[] keys, String webDiag) {
|
|
|
Map<String, Map<String, String>> diseaseCondition = new LinkedHashMap<>();
|
|
|
+ Map<String, Map<String, String>> diseaseCondition1 = new LinkedHashMap<>(16, 0.75f, true);
|
|
|
Map<String,Map<String,String>> neoPushMap = new HashMap<>();
|
|
|
List<String> newList = new ArrayList<>();
|
|
|
List<String> fildList = new ArrayList<>();
|
|
@@ -844,20 +845,38 @@ public class Neo4jAPI {
|
|
|
Record record = result.next();
|
|
|
String quezhenName = record.get("name").toString().replace("\"", "");
|
|
|
String conditionType = record.get("relationType").toString().replace("\"", "");
|
|
|
- if("拟诊".equals(conditionType) || "确诊".equals(conditionType)){
|
|
|
+ /*if("拟诊".equals(conditionType) || "确诊".equals(conditionType)){
|
|
|
que = "确诊";
|
|
|
}else {
|
|
|
que = conditionType;
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ que = conditionType;
|
|
|
Map<String, String> queMap = neoPushMap.get(quezhenName);
|
|
|
- if(queMap != null){
|
|
|
+ if(queMap != null && queMap.size()>0){
|
|
|
+ if(queMap.keySet().contains("拟诊") && "确诊".equals(que) ){
|
|
|
+ queMap.remove("拟诊");
|
|
|
+ queMap.put("确诊","");
|
|
|
+ neoPushMap.put(quezhenName,queMap);
|
|
|
+ }else if(que.equals("警惕")){
|
|
|
+ queMap.put("警惕","");
|
|
|
+ neoPushMap.put(quezhenName,queMap);
|
|
|
+ } else if(que.equals("拟诊")){
|
|
|
+ queMap.put("拟诊","");
|
|
|
+ neoPushMap.put(quezhenName,queMap);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Map<String,String> newMap = new HashMap<>();
|
|
|
+ newMap.put(que,"");
|
|
|
+ neoPushMap.put(quezhenName,newMap);
|
|
|
+ }
|
|
|
+ /* if(queMap != null){
|
|
|
queMap.put(que, "");
|
|
|
neoPushMap.put(quezhenName,queMap);
|
|
|
}else {
|
|
|
Map<String,String> newMap = new HashMap<>();
|
|
|
newMap.put(que,"");
|
|
|
neoPushMap.put(quezhenName,newMap);
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
Map<String,Map<String,String>> queHighMap = new HashMap<>();
|
|
|
Map<String,Map<String,String>> highMap = new HashMap<>();
|
|
@@ -865,7 +884,8 @@ public class Neo4jAPI {
|
|
|
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("警惕")){
|
|
|
+ Map<String,String> con = new HashMap<>();
|
|
|
+ /*if(typeSet.size() == 2 && typeSet.contains("确诊") && typeSet.contains("警惕")){
|
|
|
queHighMap.put(dis,new HashMap<>());
|
|
|
}
|
|
|
if(typeSet.size() == 1 && typeSet.contains("确诊")){
|
|
@@ -873,6 +893,24 @@ public class Neo4jAPI {
|
|
|
}
|
|
|
if(typeSet.size() == 1 && typeSet.contains("警惕")){
|
|
|
highMap.put(dis,new HashMap<>());
|
|
|
+ }*/
|
|
|
+ if(typeSet.size() == 2){
|
|
|
+ for (String type:typeSet) {
|
|
|
+ con.put(type,"");
|
|
|
+ }
|
|
|
+ queHighMap.put(dis,con);
|
|
|
+ }
|
|
|
+ if(typeSet.size() == 1 && (typeSet.contains("确诊") || typeSet.contains("拟诊"))){
|
|
|
+ for (String type:typeSet) {
|
|
|
+ con.put(type,"");
|
|
|
+ }
|
|
|
+ quezhenMap.put(dis,con);
|
|
|
+ }
|
|
|
+ if(typeSet.size() == 1 && typeSet.contains("警惕")){
|
|
|
+ for (String type:typeSet) {
|
|
|
+ con.put(type,"");
|
|
|
+ }
|
|
|
+ highMap.put(dis,con);
|
|
|
}
|
|
|
}
|
|
|
if(queHighMap != null && queHighMap.size()>0){
|
|
@@ -881,14 +919,16 @@ public class Neo4jAPI {
|
|
|
Map<String,String> k = new HashMap<>();
|
|
|
k.put("确诊","");
|
|
|
k.put("警惕","");
|
|
|
- diseaseCondition.put(dis,k);
|
|
|
+// diseaseCondition.put(dis,k);
|
|
|
+ diseaseCondition.put(dis,queHighMap.get(dis));
|
|
|
}
|
|
|
if(quezhenMap != null && quezhenMap.size()>0){
|
|
|
Set<String> queDis = quezhenMap.keySet();
|
|
|
for (String dis:queDis) {
|
|
|
Map<String,String> k = new HashMap<>();
|
|
|
k.put("确诊","");
|
|
|
- diseaseCondition.put(dis,k);
|
|
|
+// diseaseCondition.put(dis,k);
|
|
|
+ diseaseCondition.put(dis,quezhenMap.get(dis));
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
@@ -897,7 +937,8 @@ public class Neo4jAPI {
|
|
|
for (String dis:queDis) {
|
|
|
Map<String,String> k = new HashMap<>();
|
|
|
k.put("确诊","");
|
|
|
- diseaseCondition.put(dis,k);
|
|
|
+// diseaseCondition.put(dis,k);
|
|
|
+ diseaseCondition.put(dis,quezhenMap.get(dis));
|
|
|
}
|
|
|
}
|
|
|
if(highMap != null && highMap.size()>0){
|
|
@@ -905,7 +946,8 @@ public class Neo4jAPI {
|
|
|
for (String dis:highSet) {
|
|
|
Map<String,String> k = new HashMap<>();
|
|
|
k.put("警惕","");
|
|
|
- diseaseCondition.put(dis,k);
|
|
|
+// diseaseCondition.put(dis,k);
|
|
|
+ diseaseCondition.put(dis,highMap.get(dis));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -939,7 +981,7 @@ public class Neo4jAPI {
|
|
|
for (Map.Entry<String, Map<String, String>> fs:diseaseCondition.entrySet()) {
|
|
|
String dis = fs.getKey();
|
|
|
Set<String> leiSet = fs.getValue().keySet();
|
|
|
- if(leiSet.contains("确诊")){
|
|
|
+ if(leiSet.contains("确诊") || leiSet.contains("拟诊")){
|
|
|
newDis.add("\""+dis+"\"");
|
|
|
}
|
|
|
}
|
|
@@ -957,11 +999,32 @@ public class Neo4jAPI {
|
|
|
diseaseCondition.put(emDis.replace("\"", ""), stringStringMap);
|
|
|
}
|
|
|
|
|
|
+ Set<String> ll = new LinkedHashSet<>();
|
|
|
+ Set<String> kk = new LinkedHashSet<>();
|
|
|
+ for (Map.Entry<String,Map<String,String>> l:diseaseCondition.entrySet()) {
|
|
|
+ if(l.getValue().keySet().contains("确诊")){
|
|
|
+ ll.add(l.getKey());
|
|
|
+ }else {
|
|
|
+ kk.add(l.getKey());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ll.addAll(kk);
|
|
|
+ for (String dis:ll) {
|
|
|
+ Map<String, String> stringStringMap = diseaseCondition.get(dis);
|
|
|
+ for (Map.Entry<String,String>sd:stringStringMap.entrySet()) {
|
|
|
+ if("拟诊".equals(sd.getKey())){
|
|
|
+ stringStringMap.remove(sd.getKey());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ stringStringMap.put("确诊","");
|
|
|
+ diseaseCondition1.put(dis,stringStringMap);
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
|
CloseSession(session);
|
|
|
- return diseaseCondition;
|
|
|
+ return diseaseCondition1;
|
|
|
}
|
|
|
}
|
|
|
|