浏览代码

图谱接口,诊断和治疗

kongwz 6 年之前
父节点
当前提交
ffc99fd26f

+ 5 - 0
graph-web/pom.xml

@@ -30,6 +30,11 @@
 			<artifactId>public</artifactId>
 			<version>1.0.0</version>
 		</dependency>
+		<dependency>
+			<groupId>org.diagbot</groupId>
+			<artifactId>nlp</artifactId>
+			<version>1.0.0</version>
+		</dependency>
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-web</artifactId>

+ 75 - 0
graph-web/src/main/java/org/diagbot/graphWeb/controller/PushController.java

@@ -0,0 +1,75 @@
+package org.diagbot.graphWeb.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.diagbot.graph.jdbc.DriverManager;
+import org.diagbot.graph.jdbc.Neo4jAPI;
+import org.diagbot.graphWeb.work.FeatureRate;
+import org.diagbot.graphWeb.work.ParamsDataProxy;
+import org.diagbot.graphWeb.work.ResponseData;
+import org.diagbot.graphWeb.work.SearchData;
+import org.diagbot.nlp.feature.FeatureAnalyze;
+import org.diagbot.nlp.feature.FeatureType;
+import org.diagbot.pub.api.Response;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+
+@Controller
+@RequestMapping("/graph")
+public class PushController {
+    @RequestMapping(value = "/push", method = RequestMethod.POST)
+    @ResponseBody
+    public Response<ResponseData> bayesPageData(HttpServletRequest request, @RequestBody SearchData searchData) throws Exception {
+        return calculate(request, searchData);
+    }
+    public Response<ResponseData> calculate(HttpServletRequest request, SearchData searchData) throws Exception {
+        Response<ResponseData> response = new Response();
+        ResponseData responseData = new ResponseData();
+        ParamsDataProxy paramsDataProxy = new ParamsDataProxy();
+        paramsDataProxy.createSearchData(request,searchData);
+        List<String> inputList = new ArrayList<>();
+        Map<String, Map<String, String>> inputs = searchData.getInputs();
+        Set<String> ss = inputs.keySet();
+        inputList.addAll(ss);
+        Neo4jAPI neo4jAPI = new Neo4jAPI(DriverManager.newDrive());
+        //处理化验数据
+        JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(searchData.getLisArr()));
+        List<String> lisResult = neo4jAPI.AnalysisLISResult(jsonArray);
+        inputList.addAll(lisResult);
+       /* for (String s:
+            inputList ) {
+            System.out.println(s);
+        }*/
+        //计算诊断
+        Map<String, String> condition = neo4jAPI.getCondition((String[]) inputList.toArray(new String[inputList.size()]));
+        List<FeatureRate> featureRates = new ArrayList<>();
+        for (Map.Entry<String,String> d:condition.entrySet()
+             ) {
+            FeatureRate featureRate = new FeatureRate();
+            featureRate.setFeatureName(d.getKey());
+            featureRate.setExtraProperty("");
+            featureRate.setDesc(d.getValue());
+            featureRate.setRate("");
+            featureRates.add(featureRate);
+        }
+
+        //走治疗
+        if(searchData.getDiag().trim()!=null){
+            String diag = searchData.getDiag();
+            Map<String, JSONObject> mulDiseaseTreat = neo4jAPI.getMulDiseaseTreat_2(diag, String.join(",", inputList));
+            responseData.setTreat(mulDiseaseTreat);
+        }
+        responseData.setDis(featureRates);
+        response.setData(responseData);
+        responseData.setInputs(searchData.getInputs());
+        return response;
+    }
+}
+

+ 43 - 0
graph-web/src/main/java/org/diagbot/graphWeb/work/FeatureRate.java

@@ -0,0 +1,43 @@
+package org.diagbot.graphWeb.work;
+
+/**
+ * Created by fyeman on 2018/1/17.
+ */
+public class FeatureRate {
+    private String featureName;
+    private String extraProperty;
+    private String desc;
+    private String rate;
+
+    public String getFeatureName() {
+        return featureName;
+    }
+
+    public void setFeatureName(String featureName) {
+        this.featureName = featureName;
+    }
+
+    public String getRate() {
+        return rate;
+    }
+
+    public void setRate(String rate) {
+        this.rate = rate;
+    }
+
+    public String getExtraProperty() {
+        return extraProperty;
+    }
+
+    public void setExtraProperty(String extraProperty) {
+        this.extraProperty = extraProperty;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}

+ 76 - 0
graph-web/src/main/java/org/diagbot/graphWeb/work/LisDetail.java

@@ -0,0 +1,76 @@
+package org.diagbot.graphWeb.work;
+
+public class LisDetail {
+    private String detailName;
+    private String uniqueName;
+    private Double maxValue;
+    private Double minValue;
+    private String name;
+    private String otherValue;
+    private String units;
+    private Double value;
+
+    public String getDetailName() {
+        return detailName;
+    }
+
+    public void setDetailName(String detailName) {
+        this.detailName = detailName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public Double getMaxValue() {
+        return maxValue;
+    }
+
+    public void setMaxValue(Double maxValue) {
+        this.maxValue = maxValue;
+    }
+
+    public Double getMinValue() {
+        return minValue;
+    }
+
+    public void setMinValue(Double minValue) {
+        this.minValue = minValue;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOtherValue() {
+        return otherValue;
+    }
+
+    public void setOtherValue(String otherValue) {
+        this.otherValue = otherValue;
+    }
+
+    public String getUnits() {
+        return units;
+    }
+
+    public void setUnits(String units) {
+        this.units = units;
+    }
+
+    public Double getValue() {
+        return value;
+    }
+
+    public void setValue(Double value) {
+        this.value = value;
+    }
+}

+ 53 - 0
graph-web/src/main/java/org/diagbot/graphWeb/work/ParamsDataProxy.java

@@ -0,0 +1,53 @@
+package org.diagbot.graphWeb.work;
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.diagbot.nlp.feature.FeatureAnalyze;
+import org.diagbot.nlp.feature.FeatureType;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ParamsDataProxy {
+    public void createSearchData(HttpServletRequest request, SearchData searchData)throws Exception {
+        //消除空格
+        List<String> features=new ArrayList<>();
+        features.add(searchData.getSymptom().trim());
+        features.add(searchData.getOther().trim());
+        features.add(searchData.getVital().trim());
+        features.add(searchData.getLis().trim());
+        features.add(searchData.getPacs().trim());
+//        features.add(searchData.getDiag().trim());
+        searchData.setSymptom(StringUtils.join(features.toArray(),","));
+        if (searchData.getDiag() != null) {
+            searchData.setDiag(searchData.getDiag().trim());
+        }
+        //获取入参中的特征信息
+        FeatureAnalyze fa = new FeatureAnalyze();
+
+        if (!org.springframework.util.StringUtils.isEmpty(searchData.getSymptom())) {
+            List<Map<String, Object>> featuresList = fa.start(searchData.getSymptom(), FeatureType.FEATURE);
+            paramFeatureInit(searchData, featuresList, "symptomFeatureList", FeatureType.FEATURE);
+        }
+    }
+
+    private void paramFeatureInit(SearchData searchData, List<Map<String, Object>> featuresList, String property_list, FeatureType featureType) throws Exception {
+        if (featuresList != null && featuresList.size() > 0) {
+            BeanUtils.setProperty(searchData, property_list, featuresList);
+            Map<String, String> map = new HashMap<>();
+            Map<String, Object> featureMap = null;
+            for (int i = 0; i < featuresList.size(); i++) {
+                featureMap = featuresList.get(i);
+                for (Map.Entry<String, Object> entry : featureMap.entrySet()) {
+                    map.put(entry.getKey(), String.valueOf(entry.getValue()));
+                }
+                map.put("featureType", String.valueOf(featureMap.get("feature_type")));
+                map.put("featureName", String.valueOf(featureMap.get("feature_name")));
+                searchData.getInputs().put(map.get("feature_name"), map);
+            }
+        }
+    }
+}

+ 98 - 0
graph-web/src/main/java/org/diagbot/graphWeb/work/ResponseData.java

@@ -0,0 +1,98 @@
+package org.diagbot.graphWeb.work;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by fyeman on 2018/2/2.
+ */
+public class ResponseData {
+    private String participleSymptom = "";
+
+    private List<FeatureRate> symptom = new ArrayList<>(10);
+    private List<FeatureRate> vitals = new ArrayList<>(10);
+    private List<FeatureRate> dis = new ArrayList<>(10);
+    private List<FeatureRate> labs = new ArrayList<>(10);
+    private List<FeatureRate> pacs = new ArrayList<>(10);
+    private List<FeatureRate> history = new ArrayList<>(10);
+
+    private Map<String, JSONObject> treat = new HashMap<>();
+
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10,0.5f);
+
+    public String getParticipleSymptom() {
+        return participleSymptom;
+    }
+
+    public void setParticipleSymptom(String participleSymptom) {
+        this.participleSymptom = participleSymptom;
+    }
+
+    public List<FeatureRate> getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(List<FeatureRate> symptom) {
+        this.symptom = symptom;
+    }
+
+    public List<FeatureRate> getVitals() {
+        return vitals;
+    }
+
+    public void setVitals(List<FeatureRate> vitals) {
+        this.vitals = vitals;
+    }
+
+    public List<FeatureRate> getDis() {
+        return dis;
+    }
+
+    public void setDis(List<FeatureRate> dis) {
+        this.dis = dis;
+    }
+
+    public List<FeatureRate> getLabs() {
+        return labs;
+    }
+
+    public void setLabs(List<FeatureRate> labs) {
+        this.labs = labs;
+    }
+
+    public List<FeatureRate> getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(List<FeatureRate> pacs) {
+        this.pacs = pacs;
+    }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+
+    public Map<String, JSONObject> getTreat() {
+        return treat;
+    }
+
+    public void setTreat(Map<String, JSONObject> treat) {
+        this.treat = treat;
+    }
+
+    public List<FeatureRate> getHistory() {
+        return history;
+    }
+
+    public void setHistory(List<FeatureRate> history) {
+        this.history = history;
+    }
+}

+ 207 - 0
graph-web/src/main/java/org/diagbot/graphWeb/work/SearchData.java

@@ -0,0 +1,207 @@
+package org.diagbot.graphWeb.work;
+
+import org.algorithm.util.AlgorithmClassify;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SearchData {
+    private int length = 10;
+    private int age_start = 0;
+    private int age_end = 200;
+    private int age = 0;
+    private String sex;
+    // 搜索结果的贝叶斯阈值
+    private String threshold = "0";
+    //特征类别
+    private String featureType;
+    //特征类别对","进行分割后数据
+    private String[] featureTypes;
+    //门诊 住院分类
+    private String resourceType;
+    //模型
+    private AlgorithmClassify algorithmClassify[];
+    //模型
+    private String algorithmClassifyValue;
+    //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
+    private String sysCode;
+    private List<LisDetail> lisArr = new ArrayList<>();
+    private String symptom = "";
+    private String vital = "";
+    private String lis = "";
+    private String pacs = "";
+
+    public List<LisDetail> getLisArr() {
+        return lisArr;
+    }
+
+    public void setLisArr(List<LisDetail> lisArr) {
+        this.lisArr = lisArr;
+    }
+
+    private String diag = "";
+    private String past = "";
+    private String other = "";
+
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.8f);
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        this.length = length;
+    }
+
+    public int getAge_start() {
+        return age_start;
+    }
+
+    public void setAge_start(int age_start) {
+        this.age_start = age_start;
+    }
+
+    public int getAge_end() {
+        return age_end;
+    }
+
+    public void setAge_end(int age_end) {
+        this.age_end = age_end;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getFeatureType() {
+        return featureType;
+    }
+
+    public void setFeatureType(String featureType) {
+        this.featureType = featureType;
+    }
+
+    public String[] getFeatureTypes() {
+        return featureTypes;
+    }
+
+    public void setFeatureTypes(String[] featureTypes) {
+        this.featureTypes = featureTypes;
+    }
+
+    public String getResourceType() {
+        return resourceType;
+    }
+
+    public void setResourceType(String resourceType) {
+        this.resourceType = resourceType;
+    }
+
+    public String getSysCode() {
+        return sysCode;
+    }
+
+    public void setSysCode(String sysCode) {
+        this.sysCode = sysCode;
+    }
+
+    public void setThreshold(String threshold) {
+        this.threshold = threshold;
+    }
+
+    public float getThreshold() { return Float.parseFloat(threshold); }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+
+    public String getAlgorithmClassifyValue() {
+        return algorithmClassifyValue;
+    }
+
+    public void setAlgorithmClassifyValue(String algorithmClassifyValue) {
+        this.algorithmClassifyValue = algorithmClassifyValue;
+    }
+
+    public AlgorithmClassify[] getAlgorithmClassify() {
+        return algorithmClassify;
+    }
+
+    public void setAlgorithmClassify(AlgorithmClassify[] algorithmClassify) {
+        this.algorithmClassify = algorithmClassify;
+    }
+
+    public String getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(String symptom) {
+        this.symptom = symptom;
+    }
+
+    public String getVital() {
+        return vital;
+    }
+
+    public void setVital(String vital) {
+        this.vital = vital;
+    }
+
+    public String getLis() {
+        return lis;
+    }
+
+    public void setLis(String lis) {
+        this.lis = lis;
+    }
+
+    public String getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(String pacs) {
+        this.pacs = pacs;
+    }
+
+    public String getDiag() {
+        return diag;
+    }
+
+    public void setDiag(String diag) {
+        this.diag = diag;
+    }
+
+    public String getPast() {
+        return past;
+    }
+
+    public void setPast(String past) {
+        this.past = past;
+    }
+
+    public String getOther() {
+        return other;
+    }
+
+    public void setOther(String other) {
+        this.other = other;
+    }
+}

+ 151 - 1
graph/src/main/java/org/diagbot/graph/jdbc/Neo4jAPI.java

@@ -12,6 +12,7 @@ import org.neo4j.driver.v1.types.Path;
 import org.neo4j.driver.v1.types.Relationship;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.math.RoundingMode;
 import java.sql.Array;
 import java.sql.ResultSet;
 import java.text.NumberFormat;
@@ -948,7 +949,156 @@ public class Neo4jAPI {
                 return resultMap;
             }
     }
+    /**
+     * 第二版治疗方案
+     * @param disease
+     * @param filds
+     * @return
+     */
+    public Map<String, JSONObject> getMulDiseaseTreat_2(String disease,String filds){
+        Map<String, JSONObject> diagTreat = new HashMap<>();
+        JSONObject j1 = new JSONObject();
+        Session session = null;
+        NumberFormat nf   =   NumberFormat.getPercentInstance();
+        nf.setMinimumFractionDigits(0);//设置该百分比数字,保留2位小数;
+        nf.setRoundingMode(RoundingMode.HALF_UP); //设置满5向上进位,即四舍五入;
+        Map<String, String> resultMap = new HashMap<>();
+        String[] diseaseArray = disease.split(",|,|、");
+        List<String> diseaseList = new ArrayList<>();//诊断数组
+        for (int i = 0;i<diseaseArray.length;i++) {
+            diseaseList.add(diseaseArray[i]);
+        }
+        Map<String, ArrayList> diseFilds = new HashMap<>();
+        for(int i=0;i<diseaseList.size();i++) {
+            String[] fildsArray = filds.split(",");
+            ArrayList<String> fildsList = new ArrayList<>();//其他条件数组
+            for (String fild : fildsArray) {
+                fildsList.add("\'" + fild + "\'");
+            }
+            for (int j = 0; j < diseaseList.size(); j++) {
+                if (i != j) {
+                    fildsList.add("\'" + diseaseList.get(j) + "\'");
+                }
+            }
+            diseFilds.put(diseaseList.get(i), fildsList);
+        }
+        try {
+            session = driver.session(AccessMode.WRITE);
+            Integer integer = session.writeTransaction(new TransactionWork<Integer>() {
+                @Override
+                public Integer execute(Transaction tx) {
+                    StatementResult result = null;
+                    String query="";
+                    for (Map.Entry<String,ArrayList> df: diseFilds.entrySet()) {
+                        String diseaseName = df.getKey();//疾病
+                        ArrayList value = df.getValue();//其他条件
+                        StringBuffer s1 = new StringBuffer();
+                        s1.append("match (d:Disease{name:'"+diseaseName+"'})-[r0:推荐]->(m:Drugs)-[:包含]->(n:Medicine),(d)-[r1:推荐]->(n)");
+                        s1.append("\n");
+                        s1.append("where r0.p<6").append("\n");
+                        s1.append("return m.name as 类, r0.p as sort, n.name as 药物, r1.rate as a order by sort , a desc");
+                        query=s1.toString();
+                        result=tx.run(query);
+                        Map<String, LinkedHashMap<String,String>> contentMap = new  LinkedHashMap<>();
+                        while (result.hasNext()){
+                            Record record = result.next();
+                            List<Value> values = record.values();
+                            String drugs = values.get(0).toString().replace("\"", "");
+                            if(contentMap.containsKey(drugs)){
+                                LinkedHashMap<String, String> stringStringHashMap = contentMap.get(drugs);
+                                stringStringHashMap.put(values.get(2).toString().replace("\"",""),values.get(3).toString());
+                                contentMap.put(drugs,stringStringHashMap);
+                            }else {
+                                LinkedHashMap<String, String> sa = new LinkedHashMap<>();
+                                sa.put(values.get(2).toString().replace("\"",""),values.get(3).toString());
+                                contentMap.put(drugs,sa);
+                            }
+                        }
+                        //药类型的大小类拼接
+                        Map<String, String> shortLargeMap = new HashMap<>();
+                        query="match (n:Disease{name:'"+diseaseName+"'})-[:推荐]->(d:Drugs)<-[:包含]-(m) return d.name as short,m.name as large";
+                        result=tx.run(query);
+                        while (result.hasNext()){
+                            Record record = result.next();
+                            String aShort = record.get("short").toString().replace("\"","");
+                            String large = record.get("large").toString().replace("\"","");
+                            shortLargeMap.put(aShort,large+"("+aShort+")");
+                        }
+                        Map<String, LinkedHashMap<String, String>> shortLargeMapConcat = new LinkedHashMap<>();
+                        for (Map.Entry<String, LinkedHashMap<String, String>> f:contentMap.entrySet()
+                                ) {
+                            String key = f.getKey();
+                            if(shortLargeMap.get(key)!=null){
+                                shortLargeMapConcat.put(shortLargeMap.get(key),contentMap.get(key));
+                            }else {
+                                shortLargeMapConcat.put(key,contentMap.get(key));
+                            }
+                        }
+                        Map<String, String> medicationUseMap = new HashMap<>();//key:药名 value:禁忌(慎用)
+                        StringBuffer fildBuffer = new StringBuffer();
+                        fildBuffer.append("match (n:Disease{name:'" + diseaseName + "'})-[:推荐]->(d)<-[r0:慎用]-(m)").append("\n");
+                        fildBuffer.append("where m.name in " + value + "").append("\n");
+                        fildBuffer.append("return d.name as ff,type(r0) as hh").append("\n").append("union\n");
+                        fildBuffer.append("match (n:Disease{name:'" + diseaseName + "'})-[:推荐]->(d)<-[r0:忌用]-(m)\n");
+                        fildBuffer.append("where m.name in " + value + "").append("\n");
+                        fildBuffer.append("return d.name as ff,type(r0) as hh");
+                        query = fildBuffer.toString();
+                        result = tx.run(query);
+                        while (result.hasNext()) {
+                            Record next = result.next();
+                            String name = next.get("ff").toString().replace("\"", "");//药名
+                            String type = next.get("hh").toString().replace("\"", "");//忌用(慎用)
+                            medicationUseMap.put(name, type);
+                        }
 
+                        JSONObject j2 = new JSONObject();
+                        List<JSONObject> drugsList = new ArrayList<>();
+                        for (Map.Entry<String, LinkedHashMap<String, String>> w : shortLargeMapConcat.entrySet()) {
+                            int i = 0;
+                            JSONObject j4 = new JSONObject();
+                            String drugs = w.getKey();//药类
+                            List<JSONObject> meditionList = new ArrayList<>();
+                            LinkedHashMap<String, String> meditionRate = w.getValue();
+                            for (Map.Entry<String,String> g:meditionRate.entrySet()
+                                    ) {
+                                JSONObject j5 = new JSONObject();
+                                String meditionName = g.getKey().trim();//药名
+                                String rate = nf.format(Double.parseDouble(g.getValue().trim()));//百分比
+                                j5.put("medicitionName",meditionName);
+                                j5.put("rate",rate);
+                                if (i<3) {
+                                    j5.put("isShow",1);//展示
+                                    i++;
+                                } else {
+                                    j5.put("isShow",0);//不展示
+                                }
+                                if ("忌用".equals(medicationUseMap.get(meditionName))) {
+                                    j5.put("forbidden",2);
+                                } else if ("慎用".equals(medicationUseMap.get(meditionName))) {
+                                    j5.put("forbidden",1);
+                                } else {
+                                    j5.put("forbidden",0);
+                                }
+                                meditionList.add(j5);
+                            }
+                            j4.put("drugsName",drugs);
+                            j4.put("medicitionsList",meditionList);
+                            drugsList.add(j4);
+                        }
+                        j2.put("treatment",drugsList);
+//                        j1.put(diseaseName,j2);
+                        diagTreat.put(diseaseName,j2);
+                    }
+                    return 1;
+                }
+            });
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            CloseSession(session);
+            return diagTreat;
+        }
+    }
     /**
      * 倒推实现
      * @param diseaseName
@@ -1119,7 +1269,7 @@ public class Neo4jAPI {
 //                        "when judgement2 = false or judgement1 = false then false\n" +
                         "else False end as judgement order by LIS_Result";
 
-                System.out.println(query);
+//                System.out.println(query);
 
                 StatementResult run = session.run(query);
                 while (run.hasNext()) {