|
@@ -1167,7 +1167,9 @@ public class Neo4jAPI {
|
|
|
if(diseaseType !=null && 1 == diseaseType){
|
|
|
List<Indicators> indicatorsList1 = new ArrayList<>();
|
|
|
Indicators indicators1 = getAdverse(disSet, "低血糖反应");
|
|
|
+ logger.info(disSet+"包含 低血糖反应");
|
|
|
Indicators indicators2 = getAdverse(disSet, "胃肠道不良反应");
|
|
|
+ logger.info(disSet+"包含 胃肠道不良反应");
|
|
|
indicatorsList1.add(indicators1);
|
|
|
indicatorsList1.add(indicators2);
|
|
|
filnlly.setAdverseEvent(indicatorsList1);
|
|
@@ -1200,6 +1202,7 @@ public class Neo4jAPI {
|
|
|
if(dis.contains(name)){
|
|
|
detail2.setValue(1);
|
|
|
}
|
|
|
+ logger.info("有"+name+" 标记为是!!!!");
|
|
|
Detail detail3 = new Detail();
|
|
|
detail3.setName("轻度");
|
|
|
detail3.setValue(0);
|
|
@@ -1668,15 +1671,31 @@ public class Neo4jAPI {
|
|
|
threeLevelItems.put("scaleType", "");
|
|
|
|
|
|
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);
|
|
|
|
|
|
String name = "";
|
|
|
+ String calc = "";
|
|
|
+ String type = "";
|
|
|
+ String isShow = "";
|
|
|
+ String mutex = "";
|
|
|
+ String required = "";
|
|
|
+ String coefficient = "";
|
|
|
+ String constant = "";
|
|
|
+ String controlType = "";
|
|
|
String method = "";
|
|
|
- String optionOrIndex = "";
|
|
|
+ String index = "";
|
|
|
String pacsResult = "";
|
|
|
String score1 = "";
|
|
|
String score2 = "";
|
|
@@ -1688,7 +1707,7 @@ public class Neo4jAPI {
|
|
|
name = rec.get("n1.name").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("\"", "");
|
|
|
//range区间
|
|
@@ -1706,7 +1725,7 @@ public class Neo4jAPI {
|
|
|
result = new TreeMap<>();
|
|
|
result.put("min", min);
|
|
|
result.put("max", max);
|
|
|
- result.put("text", optionOrIndex);
|
|
|
+ result.put("text", index);
|
|
|
result.put("priority", priority);
|
|
|
results.add(result);
|
|
|
}
|
|
@@ -1726,7 +1745,7 @@ public class Neo4jAPI {
|
|
|
threeLevelItems.put("title", titles);
|
|
|
|
|
|
if ("NULL".equals(method) && !"NULL".equals(pacsResult)) {
|
|
|
- optionOrIndex = optionOrIndex + "_" + priority;
|
|
|
+ index = index + "_" + priority;
|
|
|
|
|
|
Map<String, String> detailInfo = new LinkedHashMap<>();
|
|
|
detailInfo.put("detailName", pacsResult);
|
|
@@ -1734,11 +1753,11 @@ public class Neo4jAPI {
|
|
|
detailInfo.put("state", "0");
|
|
|
detailInfo.put("priority", priority);
|
|
|
|
|
|
- if (nameDetails.containsKey(optionOrIndex)) {
|
|
|
- nameDetails.get(optionOrIndex).add(detailInfo);
|
|
|
+ if (nameDetails.containsKey(index)) {
|
|
|
+ nameDetails.get(index).add(detailInfo);
|
|
|
} else {
|
|
|
- nameDetails.put(optionOrIndex, new ArrayList<>());
|
|
|
- nameDetails.get(optionOrIndex).add(detailInfo);
|
|
|
+ nameDetails.put(index, new ArrayList<>());
|
|
|
+ nameDetails.get(index).add(detailInfo);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1812,7 +1831,7 @@ public class Neo4jAPI {
|
|
|
* @param scaleName
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String, Object> getScaleCalc2(String scaleName) {
|
|
|
+ public Map<String, Object> getScaleCalc2(String[] scaleItems,String scaleName) {
|
|
|
Session session = driver.session(AccessMode.READ);
|
|
|
StatementResult Rset = null;
|
|
|
Record rec;
|
|
@@ -1951,7 +1970,19 @@ public class Neo4jAPI {
|
|
|
JSONObject rowDetail = new JSONObject();
|
|
|
rowDetail.put("detailName", pacsResult);
|
|
|
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);
|
|
|
row.put("details", details);
|
|
|
}
|
|
@@ -1977,7 +2008,20 @@ public class Neo4jAPI {
|
|
|
JSONObject rowDetail = new JSONObject();
|
|
|
rowDetail.put("detailName", pacsResult);
|
|
|
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();
|
|
|
details.add(rowDetail);
|
|
|
row.put("details", details);
|
|
@@ -2087,7 +2131,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;
|
|
|
String final_result = null;
|
|
@@ -2130,70 +2174,6 @@ public class Neo4jAPI {
|
|
|
result.put("text", final_result);
|
|
|
return scaleCalc;
|
|
|
}
|
|
|
-
|
|
|
- public Map<String, Object> calcMethod() {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- return map;
|
|
|
- }
|
|
|
-
|
|
|
- public String scaleCalcMethod(String[] scaleItems, String scaleName) {
|
|
|
- String result = null;
|
|
|
- Map<String, Object> calcMap = calcMethod();
|
|
|
- List<Map<String, Object>> calcTypes = (List<Map<String, Object>>) calcMap.get("details");
|
|
|
- for (Map<String, Object> calcType : calcTypes) {
|
|
|
- switch ((int) calcType.get("type")) {
|
|
|
- case 1:
|
|
|
- result = scaleScoreCalc(scaleItems, scaleName).get("text").toString();
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- Map<String, Object> content = (Map<String, Object>) calcType.get("content");
|
|
|
- List<Map<String, Object>> details = (List<Map<String, Object>>) content.get("details");
|
|
|
- int age = 0;
|
|
|
-// double scr = 0.00;
|
|
|
- double scr = 2.2621;
|
|
|
- float k = 0.0f;
|
|
|
- double a = 0.00;
|
|
|
- double denger = 0.00;
|
|
|
- for (Map<String, Object> detailsMap : details) {
|
|
|
- if ("年龄".equals(detailsMap.get("name").toString())) {
|
|
|
- age = (int) detailsMap.get("value");
|
|
|
- } else if ("血肌酐".equals(detailsMap.get("name").toString())) {
|
|
|
- if ("umol/L".equals(detailsMap.get("uint"))) {
|
|
|
- scr = (double) detailsMap.get("value") * 88.41;
|
|
|
- } else {
|
|
|
- scr = (double) detailsMap.get("value");
|
|
|
- }
|
|
|
- } else if ("性别".equals(detailsMap.get("name").toString())) {
|
|
|
- List<Map<String, Object>> genderDetails = (List<Map<String, Object>>) detailsMap.get("details");
|
|
|
- for (Map<String, Object> genderDetail : genderDetails) {
|
|
|
- if ("男".equals(genderDetail.get("detailName").toString())) {
|
|
|
- k = 0.9f;
|
|
|
- denger = (double) genderDetail.get("value");
|
|
|
- if (scr <= 0.90) {
|
|
|
- a = -0.411;
|
|
|
- } else {
|
|
|
- a = -1.209;
|
|
|
- }
|
|
|
- } else if ("女".equals(genderDetail.get("detailName").toString())) {
|
|
|
- k = 0.7f;
|
|
|
- denger = (double) genderDetail.get("value");
|
|
|
- if (scr <= 0.70) {
|
|
|
- a = -0.329;
|
|
|
- } else {
|
|
|
- a = -1.209;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- age = 20;
|
|
|
- double eGFR3 = 141 * Math.pow((scr / k), a) * Math.pow(0.993, age) * denger;
|
|
|
- System.out.println(eGFR3);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return result;
|
|
|
- }
|
|
|
+ */
|
|
|
|
|
|
}
|