|
@@ -905,11 +905,10 @@ public class Neo4jAPI {
|
|
for (Map.Entry<String, LinkedHashMap<String, String>> w : mapSortValueDa.entrySet()) {
|
|
for (Map.Entry<String, LinkedHashMap<String, String>> w : mapSortValueDa.entrySet()) {
|
|
int i = 0;
|
|
int i = 0;
|
|
Drugs drugs1 = new Drugs();
|
|
Drugs drugs1 = new Drugs();
|
|
- drugs1.setDrugsName(w.getKey().trim());//药类
|
|
|
|
|
|
+// drugs1.setDrugsName(w.getKey().trim());//药类
|
|
LinkedList<Medicition> medicitions = new LinkedList<>();
|
|
LinkedList<Medicition> medicitions = new LinkedList<>();
|
|
LinkedHashMap<String, String> value2 = w.getValue();
|
|
LinkedHashMap<String, String> value2 = w.getValue();
|
|
for (Map.Entry<String, String> d : value2.entrySet()) {
|
|
for (Map.Entry<String, String> d : value2.entrySet()) {
|
|
-// System.out.println(w.getKey()+" "+d.getKey()+" "+d.getValue());
|
|
|
|
Medicition medicition = new Medicition();
|
|
Medicition medicition = new Medicition();
|
|
medicition.setMedicitionName(d.getKey().trim());//药名
|
|
medicition.setMedicitionName(d.getKey().trim());//药名
|
|
medicition.setRate(nf.format(Double.parseDouble(d.getValue().trim())));//使用率
|
|
medicition.setRate(nf.format(Double.parseDouble(d.getValue().trim())));//使用率
|
|
@@ -1013,7 +1012,8 @@ public class Neo4jAPI {
|
|
}
|
|
}
|
|
//药类型的大小类拼接
|
|
//药类型的大小类拼接
|
|
Map<String, String> shortLargeMap = new HashMap<>();
|
|
Map<String, String> shortLargeMap = new HashMap<>();
|
|
- query="match (n:Disease{name:'"+diseaseName+"'})-[:推荐]->(d:Drugs)<-[:包含]-(m) return d.name as short,m.name as large";
|
|
|
|
|
|
+// query="match (n:Disease{name:'"+diseaseName+"'})-[:推荐]->(d:Drugs)<-[:包含]-(m) return d.name as short,m.name as large";
|
|
|
|
+ query="match (n:Disease{name:'"+diseaseName+"'})-[r0:推荐]->(m:Drugs)-[:包含]->(k:Drugs) return k.name as short,m.name as large";
|
|
result=tx.run(query);
|
|
result=tx.run(query);
|
|
while (result.hasNext()){
|
|
while (result.hasNext()){
|
|
Record record = result.next();
|
|
Record record = result.next();
|
|
@@ -1049,10 +1049,13 @@ public class Neo4jAPI {
|
|
}
|
|
}
|
|
//大对象集合
|
|
//大对象集合
|
|
ArrayList<Drugs> drugsList = new ArrayList<Drugs>();
|
|
ArrayList<Drugs> drugsList = new ArrayList<Drugs>();
|
|
|
|
+ DrugsPattern drugsPattern = new DrugsPattern();
|
|
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;
|
|
Drugs drugs = new Drugs();
|
|
Drugs drugs = new Drugs();
|
|
String drugsName = w.getKey();//药类
|
|
String drugsName = w.getKey();//药类
|
|
|
|
+// Map<String, String> bigSubDrugs = new DrugsPattern().bigSubDrugs(drugsName);
|
|
|
|
+ Map<String, String> bigSubDrugs = drugsPattern.bigSubDrugs(drugsName);
|
|
LinkedList<Medicition> medicitionsList=new LinkedList<>();
|
|
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()
|
|
@@ -1077,7 +1080,8 @@ public class Neo4jAPI {
|
|
}
|
|
}
|
|
medicitionsList.add(medicition);
|
|
medicitionsList.add(medicition);
|
|
}
|
|
}
|
|
- drugs.setDrugsName(drugsName);
|
|
|
|
|
|
+ drugs.setBigdrugsName(bigSubDrugs.get("big"));
|
|
|
|
+ drugs.setSubdrugsName(bigSubDrugs.get("sub"));
|
|
drugs.setMedicitionsList(medicitionsList);
|
|
drugs.setMedicitionsList(medicitionsList);
|
|
drugsList.add(drugs);
|
|
drugsList.add(drugs);
|
|
}
|
|
}
|