|
@@ -3,9 +3,9 @@ import com.alibaba.druid.support.json.JSONUtils;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
-import org.diagbot.graph.javabean.Drugs;
|
|
|
|
-import org.diagbot.graph.javabean.Filnlly;
|
|
|
|
-import org.diagbot.graph.javabean.Medicition;
|
|
|
|
|
|
+import org.diagbot.common.work.Drugs;
|
|
|
|
+import org.diagbot.common.work.Filnlly;
|
|
|
|
+import org.diagbot.common.work.Medicition;
|
|
import org.neo4j.driver.v1.*;
|
|
import org.neo4j.driver.v1.*;
|
|
import org.neo4j.driver.v1.types.Node;
|
|
import org.neo4j.driver.v1.types.Node;
|
|
import org.neo4j.driver.v1.types.Path;
|
|
import org.neo4j.driver.v1.types.Path;
|
|
@@ -13,8 +13,6 @@ import org.neo4j.driver.v1.types.Relationship;
|
|
import java.io.FileWriter;
|
|
import java.io.FileWriter;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
-import java.sql.Array;
|
|
|
|
-import java.sql.ResultSet;
|
|
|
|
import java.text.NumberFormat;
|
|
import java.text.NumberFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -955,9 +953,8 @@ public class Neo4jAPI {
|
|
* @param filds
|
|
* @param filds
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public Map<String, JSONObject> getMulDiseaseTreat_2(String disease,String filds){
|
|
|
|
- Map<String, JSONObject> diagTreat = new HashMap<>();
|
|
|
|
- JSONObject j1 = new JSONObject();
|
|
|
|
|
|
+ public Map<String, Filnlly> getMulDiseaseTreat_2(String disease,String filds){
|
|
|
|
+ Map<String, Filnlly> diagTreat = new HashMap<>();
|
|
Session session = null;
|
|
Session session = null;
|
|
NumberFormat nf = NumberFormat.getPercentInstance();
|
|
NumberFormat nf = NumberFormat.getPercentInstance();
|
|
nf.setMinimumFractionDigits(0);//设置该百分比数字,保留2位小数;
|
|
nf.setMinimumFractionDigits(0);//设置该百分比数字,保留2位小数;
|
|
@@ -1050,44 +1047,44 @@ public class Neo4jAPI {
|
|
String type = next.get("hh").toString().replace("\"", "");//忌用(慎用)
|
|
String type = next.get("hh").toString().replace("\"", "");//忌用(慎用)
|
|
medicationUseMap.put(name, type);
|
|
medicationUseMap.put(name, type);
|
|
}
|
|
}
|
|
-
|
|
|
|
- JSONObject j2 = new JSONObject();
|
|
|
|
- List<JSONObject> drugsList = new ArrayList<>();
|
|
|
|
|
|
+ //大对象集合
|
|
|
|
+ ArrayList<Drugs> drugsList = new ArrayList<Drugs>();
|
|
for (Map.Entry<String, LinkedHashMap<String, String>> w : shortLargeMapConcat.entrySet()) {
|
|
for (Map.Entry<String, LinkedHashMap<String, String>> w : shortLargeMapConcat.entrySet()) {
|
|
int i = 0;
|
|
int i = 0;
|
|
- JSONObject j4 = new JSONObject();
|
|
|
|
- String drugs = w.getKey();//药类
|
|
|
|
- List<JSONObject> meditionList = new ArrayList<>();
|
|
|
|
|
|
+ Drugs drugs = new Drugs();
|
|
|
|
+ String drugsName = w.getKey();//药类
|
|
|
|
+ LinkedList<Medicition> medicitionsList=new LinkedList<>();
|
|
LinkedHashMap<String, String> meditionRate = w.getValue();
|
|
LinkedHashMap<String, String> meditionRate = w.getValue();
|
|
for (Map.Entry<String,String> g:meditionRate.entrySet()
|
|
for (Map.Entry<String,String> g:meditionRate.entrySet()
|
|
) {
|
|
) {
|
|
- JSONObject j5 = new JSONObject();
|
|
|
|
|
|
+ Medicition medicition = new Medicition();
|
|
String meditionName = g.getKey().trim();//药名
|
|
String meditionName = g.getKey().trim();//药名
|
|
String rate = nf.format(Double.parseDouble(g.getValue().trim()));//百分比
|
|
String rate = nf.format(Double.parseDouble(g.getValue().trim()));//百分比
|
|
- j5.put("medicitionName",meditionName);
|
|
|
|
- j5.put("rate",rate);
|
|
|
|
|
|
+ medicition.setMedicitionName(meditionName);
|
|
|
|
+ medicition.setRate(rate);
|
|
if (i<3) {
|
|
if (i<3) {
|
|
- j5.put("isShow",1);//展示
|
|
|
|
|
|
+ medicition.setIsShow(1);
|
|
i++;
|
|
i++;
|
|
} else {
|
|
} else {
|
|
- j5.put("isShow",0);//不展示
|
|
|
|
|
|
+ medicition.setIsShow(0);
|
|
}
|
|
}
|
|
if ("忌用".equals(medicationUseMap.get(meditionName))) {
|
|
if ("忌用".equals(medicationUseMap.get(meditionName))) {
|
|
- j5.put("forbidden",2);
|
|
|
|
|
|
+ medicition.setForbidden(2);
|
|
} else if ("慎用".equals(medicationUseMap.get(meditionName))) {
|
|
} else if ("慎用".equals(medicationUseMap.get(meditionName))) {
|
|
- j5.put("forbidden",1);
|
|
|
|
|
|
+ medicition.setForbidden(1);
|
|
} else {
|
|
} else {
|
|
- j5.put("forbidden",0);
|
|
|
|
|
|
+ medicition.setForbidden(0);
|
|
}
|
|
}
|
|
- meditionList.add(j5);
|
|
|
|
|
|
+ medicitionsList.add(medicition);
|
|
}
|
|
}
|
|
- j4.put("drugsName",drugs);
|
|
|
|
- j4.put("medicitionsList",meditionList);
|
|
|
|
- drugsList.add(j4);
|
|
|
|
|
|
+ drugs.setDrugsName(drugsName);
|
|
|
|
+ drugs.setMedicitionsList(medicitionsList);
|
|
|
|
+ drugsList.add(drugs);
|
|
}
|
|
}
|
|
- j2.put("treatment",drugsList);
|
|
|
|
-// j1.put(diseaseName,j2);
|
|
|
|
- diagTreat.put(diseaseName,j2);
|
|
|
|
|
|
+ Filnlly filnlly = new Filnlly();
|
|
|
|
+ filnlly.setTreatment(drugsList);
|
|
|
|
+ diagTreat.put(diseaseName,filnlly);
|
|
|
|
+
|
|
}
|
|
}
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|