|
@@ -34,6 +34,7 @@ public class GraphCalculate {
|
|
|
}
|
|
|
}
|
|
|
private static Neo4jAPI neo4jAPI ;
|
|
|
+ private static Map<String,List<String>> mergeMap;
|
|
|
|
|
|
/**
|
|
|
* 返回诊断和治疗
|
|
@@ -155,6 +156,7 @@ public class GraphCalculate {
|
|
|
idns.addAll(idn);
|
|
|
}
|
|
|
}
|
|
|
+ newindSet1 = mergerIndex(newindSet1, mergeMap);
|
|
|
if(newindSet1 != null && newindSet1.size()>0){
|
|
|
for (String ind:newindSet1
|
|
|
) {
|
|
@@ -182,6 +184,38 @@ public class GraphCalculate {
|
|
|
System.out.println("Total takes: " + (System.currentTimeMillis()-starttime)/1000d + 's');
|
|
|
return responseData;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 合并指标
|
|
|
+ * @param newindSet
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Set<String> mergerIndex(Set<String> newindSet,Map<String,List<String>> merge){
|
|
|
+ Map<String, List<String>> mergeInit = mergeInit(merge);
|
|
|
+ if(newindSet != null && newindSet.size()>0){
|
|
|
+ for (Map.Entry<String, List<String>> ds:mergeInit.entrySet()) {
|
|
|
+ String key = ds.getKey();
|
|
|
+ List<String> values = ds.getValue();
|
|
|
+ boolean b = newindSet.retainAll(values);
|
|
|
+ if(newindSet.contains(key) && b ){
|
|
|
+ newindSet.remove(key);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return newindSet;
|
|
|
+ }
|
|
|
+ private Map<String,List<String>> mergeInit(Map<String,List<String>> merge){
|
|
|
+ if(merge == null){
|
|
|
+ merge = new HashMap<>();
|
|
|
+ List<String> otherIn = new ArrayList<>();
|
|
|
+ otherIn.add("2型糖尿病");
|
|
|
+ otherIn.add("1型糖尿病");
|
|
|
+ otherIn.add("成人迟发性自身免疫糖尿病");
|
|
|
+ merge.put("糖尿病",otherIn);
|
|
|
+ }
|
|
|
+ return merge;
|
|
|
+ }
|
|
|
|
|
|
private Set<String> getQueNiDiagnose(Map<String, Object> condition) {
|
|
|
Set<String> diseaseSet =new HashSet<>();
|