|
@@ -1668,15 +1668,31 @@ public class Neo4jAPI {
|
|
threeLevelItems.put("scaleType", "");
|
|
threeLevelItems.put("scaleType", "");
|
|
|
|
|
|
try {
|
|
try {
|
|
- String query = "match (m:Scale)-[r1]->(n1)-[r2]->(n2)-[r3]->(n3) WHERE m.name=~'.*" + scaleName + ".*' " +
|
|
|
|
- "return n1.name, n1.method, r1.score, n2.name, r2.score,n2.type, r2.p,n3.name as n3name,r3.score as r3score, r3.p as r3p, n3.type as n3type order by toInt(r2.p),n2.type " +
|
|
|
|
- "union match (m:Scale)-[r1]->(n1)-[r2]->(n2) WHERE m.name=~'.*" + scaleName + ".*' return n1.name,n1.method, r1.score,n2.name,r2.score,n2.type,r2.p, null as n3name, null as r3score, null as r3p, null as n3type order by toInt(r2.p),n2.type";
|
|
|
|
|
|
+ String query = "match (m:Scale)-[r1]->(n1)-[r2]->(n2)-[r3]->(n3)-[r4]->(n4) " +
|
|
|
|
+ "WHERE m.name=~'.*"+scaleName+".*' " +
|
|
|
|
+ "return m.name,m.calc,m.type,n1.name,n1.isShow,r2.mutex as r2mutex,n2.name," +
|
|
|
|
+ "n2.required as n2required,n3.name as n3name,n3.coefficient as n3coefficient," +
|
|
|
|
+ "n3.constant as n3constant,n3.controlType as n3controlType, r4.score as r4score," +
|
|
|
|
+ "n4.name as n4name order by toInt(r1.p),toInt(r2.p),toInt(r3.p),toInt(r4.p) " +
|
|
|
|
+ "union " +
|
|
|
|
+ "match (m:Scale)-[r1]->(n1:Method)-[r2]->(n2) WHERE m.name=~'.*"+scaleName+".*' " +
|
|
|
|
+ "return m.name,m.calc,m.type,n1.name,n1.isShow,r2.score as r2mutex,n2.name,null as n2required," +
|
|
|
|
+ "null as n3name,null as n3coefficient,null as n3constant,null as n3controlType,null as r4score, " +
|
|
|
|
+ "null as n4name";
|
|
|
|
|
|
Rset = session.run(query);
|
|
Rset = session.run(query);
|
|
|
|
|
|
String name = "";
|
|
String name = "";
|
|
|
|
+ String calc = "";
|
|
|
|
+ String type = "";
|
|
|
|
+ String isShow = "";
|
|
|
|
+ String mutex = "";
|
|
|
|
+ String required = "";
|
|
|
|
+ String coefficient = "";
|
|
|
|
+ String constant = "";
|
|
|
|
+ String controlType = "";
|
|
String method = "";
|
|
String method = "";
|
|
- String optionOrIndex = "";
|
|
|
|
|
|
+ String index = "";
|
|
String pacsResult = "";
|
|
String pacsResult = "";
|
|
String score1 = "";
|
|
String score1 = "";
|
|
String score2 = "";
|
|
String score2 = "";
|
|
@@ -1688,7 +1704,7 @@ public class Neo4jAPI {
|
|
name = rec.get("n1.name").toString().replace("\"", "");
|
|
name = rec.get("n1.name").toString().replace("\"", "");
|
|
method = rec.get("n1.method").toString().replace("\"", "");
|
|
method = rec.get("n1.method").toString().replace("\"", "");
|
|
//轻度 右拇指振动觉
|
|
//轻度 右拇指振动觉
|
|
- optionOrIndex = rec.get("n2.name").toString().replace("\"", "");
|
|
|
|
|
|
+ index = rec.get("n2.name").toString().replace("\"", "");
|
|
//正常 异常
|
|
//正常 异常
|
|
pacsResult = rec.get("n3name").toString().replace("\"", "");
|
|
pacsResult = rec.get("n3name").toString().replace("\"", "");
|
|
//range区间
|
|
//range区间
|
|
@@ -1706,7 +1722,7 @@ public class Neo4jAPI {
|
|
result = new TreeMap<>();
|
|
result = new TreeMap<>();
|
|
result.put("min", min);
|
|
result.put("min", min);
|
|
result.put("max", max);
|
|
result.put("max", max);
|
|
- result.put("text", optionOrIndex);
|
|
|
|
|
|
+ result.put("text", index);
|
|
result.put("priority", priority);
|
|
result.put("priority", priority);
|
|
results.add(result);
|
|
results.add(result);
|
|
}
|
|
}
|
|
@@ -1726,7 +1742,7 @@ public class Neo4jAPI {
|
|
threeLevelItems.put("title", titles);
|
|
threeLevelItems.put("title", titles);
|
|
|
|
|
|
if ("NULL".equals(method) && !"NULL".equals(pacsResult)) {
|
|
if ("NULL".equals(method) && !"NULL".equals(pacsResult)) {
|
|
- optionOrIndex = optionOrIndex + "_" + priority;
|
|
|
|
|
|
+ index = index + "_" + priority;
|
|
|
|
|
|
Map<String, String> detailInfo = new LinkedHashMap<>();
|
|
Map<String, String> detailInfo = new LinkedHashMap<>();
|
|
detailInfo.put("detailName", pacsResult);
|
|
detailInfo.put("detailName", pacsResult);
|
|
@@ -1734,11 +1750,11 @@ public class Neo4jAPI {
|
|
detailInfo.put("state", "0");
|
|
detailInfo.put("state", "0");
|
|
detailInfo.put("priority", priority);
|
|
detailInfo.put("priority", priority);
|
|
|
|
|
|
- if (nameDetails.containsKey(optionOrIndex)) {
|
|
|
|
- nameDetails.get(optionOrIndex).add(detailInfo);
|
|
|
|
|
|
+ if (nameDetails.containsKey(index)) {
|
|
|
|
+ nameDetails.get(index).add(detailInfo);
|
|
} else {
|
|
} else {
|
|
- nameDetails.put(optionOrIndex, new ArrayList<>());
|
|
|
|
- nameDetails.get(optionOrIndex).add(detailInfo);
|
|
|
|
|
|
+ nameDetails.put(index, new ArrayList<>());
|
|
|
|
+ nameDetails.get(index).add(detailInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1812,7 +1828,7 @@ public class Neo4jAPI {
|
|
* @param scaleName
|
|
* @param scaleName
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public Map<String, Object> getScaleCalc2(String scaleName) {
|
|
|
|
|
|
+ public Map<String, Object> getScaleCalc2(String[] scaleItems,String scaleName) {
|
|
Session session = driver.session(AccessMode.READ);
|
|
Session session = driver.session(AccessMode.READ);
|
|
StatementResult Rset = null;
|
|
StatementResult Rset = null;
|
|
Record rec;
|
|
Record rec;
|
|
@@ -1951,7 +1967,19 @@ public class Neo4jAPI {
|
|
JSONObject rowDetail = new JSONObject();
|
|
JSONObject rowDetail = new JSONObject();
|
|
rowDetail.put("detailName", pacsResult);
|
|
rowDetail.put("detailName", pacsResult);
|
|
rowDetail.put("score", score2);
|
|
rowDetail.put("score", score2);
|
|
- rowDetail.put("state", 0);
|
|
|
|
|
|
+ JSONArray scaleItem = (JSONArray) JSONArray.toJSON(scaleItems);
|
|
|
|
+ for (int k = 0; k < scaleItem.size(); k++) {
|
|
|
|
+ if (scaleItem.get(k).toString().contains(row.getString("name"))){
|
|
|
|
+ if (scaleItem.get(k).toString().contains(pacsResult)){
|
|
|
|
+ rowDetail.put("state", 1);
|
|
|
|
+ scaleItem.remove(k);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ rowDetail.put("state", 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
details.add(rowDetail);
|
|
details.add(rowDetail);
|
|
row.put("details", details);
|
|
row.put("details", details);
|
|
}
|
|
}
|
|
@@ -1977,7 +2005,20 @@ public class Neo4jAPI {
|
|
JSONObject rowDetail = new JSONObject();
|
|
JSONObject rowDetail = new JSONObject();
|
|
rowDetail.put("detailName", pacsResult);
|
|
rowDetail.put("detailName", pacsResult);
|
|
rowDetail.put("score", score2);
|
|
rowDetail.put("score", score2);
|
|
- rowDetail.put("state", 0);
|
|
|
|
|
|
+ JSONArray scaleItem = (JSONArray) JSONArray.toJSON(scaleItems);
|
|
|
|
+ for (int k = 0; k < scaleItem.size(); k++) {
|
|
|
|
+ if (scaleItem.get(k).toString().contains(row.getString("name"))){
|
|
|
|
+ if (scaleItem.get(k).toString().contains(pacsResult)){
|
|
|
|
+ rowDetail.put("state", 1);
|
|
|
|
+ scaleItem.remove(k);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ rowDetail.put("state", 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+// rowDetail.put("state", 0);
|
|
JSONArray details = new JSONArray();
|
|
JSONArray details = new JSONArray();
|
|
details.add(rowDetail);
|
|
details.add(rowDetail);
|
|
row.put("details", details);
|
|
row.put("details", details);
|
|
@@ -2087,7 +2128,7 @@ public class Neo4jAPI {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public Map<String, Object> scaleScoreCalc(String[] scaleItems, String scaleName) {
|
|
|
|
|
|
+ /*public Map<String, Object> scaleScoreCalc(String[] scaleItems, String scaleName) {
|
|
|
|
|
|
int sum = 0;
|
|
int sum = 0;
|
|
String final_result = null;
|
|
String final_result = null;
|
|
@@ -2130,10 +2171,6 @@ public class Neo4jAPI {
|
|
result.put("text", final_result);
|
|
result.put("text", final_result);
|
|
return scaleCalc;
|
|
return scaleCalc;
|
|
}
|
|
}
|
|
-
|
|
|
|
- public Map<String, Object> calcMethod() {
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
- return map;
|
|
|
|
- }
|
|
|
|
|
|
+ */
|
|
|
|
|
|
}
|
|
}
|