|
@@ -34,6 +34,7 @@ public class GraphCalculate {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
private static Neo4jAPI neo4jAPI ;
|
|
private static Neo4jAPI neo4jAPI ;
|
|
|
|
+ private static Map<String,List<String>> mergeMap;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 返回诊断和治疗
|
|
* 返回诊断和治疗
|
|
@@ -155,6 +156,7 @@ public class GraphCalculate {
|
|
idns.addAll(idn);
|
|
idns.addAll(idn);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ newindSet1 = mergerIndex(newindSet1, mergeMap);
|
|
if(newindSet1 != null && newindSet1.size()>0){
|
|
if(newindSet1 != null && newindSet1.size()>0){
|
|
for (String ind:newindSet1
|
|
for (String ind:newindSet1
|
|
) {
|
|
) {
|
|
@@ -183,6 +185,69 @@ public class GraphCalculate {
|
|
return responseData;
|
|
return responseData;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 合并指标
|
|
|
|
+ * @param newindSet
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private Set<String> mergerIndex(Set<String> newindSet,Map<String,List<String>> merge){
|
|
|
|
+ Map<String,List<String>> disColl = new HashMap<>();
|
|
|
|
+ Set<String> newindSetResult = new HashSet<>();
|
|
|
|
+ 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();
|
|
|
|
+ if(newindSet.contains(key)){
|
|
|
|
+ Iterator<String> iterator = newindSet.iterator();
|
|
|
|
+ while (iterator.hasNext()){
|
|
|
|
+ String next = iterator.next();
|
|
|
|
+ // values ["2型糖尿病","1型糖尿病","成人迟发性自身免疫糖尿病"]
|
|
|
|
+ // newindSet ["糖尿病","糖尿病足"]
|
|
|
|
+ if(key.equals(next)){
|
|
|
|
+ List<String> disList = new ArrayList<>();
|
|
|
|
+ for (String dis:newindSet) {
|
|
|
|
+ if(!dis.equals(key)){
|
|
|
|
+ disList.add(dis);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ disColl.put(key,disList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(disColl != null && disColl.size()>0){
|
|
|
|
+ for (Map.Entry<String,List<String>> disList:disColl.entrySet()) {
|
|
|
|
+ String key1 = disList.getKey();
|
|
|
|
+ List<String> value = disList.getValue();
|
|
|
|
+ if(value.size() == 0){
|
|
|
|
+ newindSetResult.add(key1);
|
|
|
|
+ }else {
|
|
|
|
+ for (String dis:value
|
|
|
|
+ ) {
|
|
|
|
+ if(!dis.equals(key1)){
|
|
|
|
+ newindSetResult.add(dis);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ newindSetResult = newindSet;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return newindSetResult;
|
|
|
|
+ }
|
|
|
|
+ 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) {
|
|
private Set<String> getQueNiDiagnose(Map<String, Object> condition) {
|
|
Set<String> diseaseSet =new HashSet<>();
|
|
Set<String> diseaseSet =new HashSet<>();
|
|
if(condition != null){
|
|
if(condition != null){
|