瀏覽代碼

诊断推理修改

kongwz 6 年之前
父節點
當前提交
f54bfadaa2

+ 10 - 0
common-service/src/main/java/org/diagbot/common/work/ResponseData.java

@@ -1,4 +1,5 @@
 package org.diagbot.common.work;
+import com.alibaba.fastjson.JSONObject;
 import org.diagbot.common.javabean.Filnlly;
 import org.diagbot.common.javabean.MedicalIndication;
 
@@ -23,6 +24,15 @@ public class ResponseData {
     private Map<String, Filnlly> treat = new HashMap<>();
     private List<FeatureRate> graphWords = new ArrayList<>(10);
     private List<MedicalIndication> medicalIndications;//量表和指标推送
+    private Map<String,JSONObject> managementEvaluation; //管理评估
+
+    public Map<String, JSONObject> getManagementEvaluation() {
+        return managementEvaluation;
+    }
+
+    public void setManagementEvaluation(Map<String, JSONObject> managementEvaluation) {
+        this.managementEvaluation = managementEvaluation;
+    }
 
     public List<MedicalIndication> getMedicalIndications() {
         return medicalIndications;

+ 49 - 13
graph-web/src/main/java/org/diagbot/graphWeb/work/GraphCalculate.java

@@ -39,20 +39,16 @@ public class GraphCalculate {
         //计算诊断
         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("");
-            if("低血糖反应".equals(d.getKey()) || "胃肠道不良反应".equals(d.getKey())
-                    || "肾功能不全".equals(d.getKey())){
-                featureRate.setDesc(d.getValue());
-                featureRate.setRate("治疗影响");
-            }else {
+        for (Map.Entry<String,String> d:condition.entrySet()) {
+            if(!"低血糖反应".equals(d.getKey()) && !"胃肠道不良反应".equals(d.getKey())
+                    && !"肾功能不全".equals(d.getKey())){
+                FeatureRate featureRate = new FeatureRate();
+                featureRate.setFeatureName(d.getKey());
+                featureRate.setExtraProperty("");
                 featureRate.setDesc(d.getValue());
                 featureRate.setRate("neo4j");
+                featureRates.add(featureRate);
             }
-            featureRates.add(featureRate);
         }
         String webDiag = searchData.getDiag();
         Set<String> diseaseSet = condition.keySet();
@@ -66,12 +62,19 @@ public class GraphCalculate {
         }
         //管理评估
         if("11".equals(featureType) && diseaseType == 1){
-
+            MangementEvaluation mangementEvaluation = this.getMangementEvaluation();
+            Map<String, JSONObject> mangementEvaluation1 = mangementEvaluation.getMangementEvaluation();
+            responseData.setManagementEvaluation(mangementEvaluation1);
         }
+        //指标推送
         List<MedicalIndication> medicalIndicationList = new ArrayList<>();
         MedicalIndication medicalIndication = this.getMedicalIndication(diseaseSet);
         medicalIndicationList.add(medicalIndication);
-        responseData.setMedicalIndications(medicalIndicationList);
+        if(medicalIndicationList != null && medicalIndicationList.size()>0){
+            responseData.setMedicalIndications(medicalIndicationList);
+        }
+        //诊断推送
+
         responseData.setDis(featureRates);
         responseData.setInputs(searchData.getInputs());
         return responseData;
@@ -317,11 +320,44 @@ public class GraphCalculate {
         }
         bloodPressure.put("details",bloodPressureLevelList);
         itemJson.add(bloodPressure);
+
+        JSONObject bmiControl = new JSONObject();
+        bmiControl.put("controltype",0);
+        bmiControl.put("name","BMI控制情况");
+        List<JSONObject> bmiControlLevelList = new ArrayList<>();
+        String[] bmiControlitems= {"体重过低","体重达标","肥胖前期","肥胖"};
+        for (String item:bmiControlitems) {
+            JSONObject iJson = new JSONObject();
+            iJson.put("detailName",item);
+            iJson.put("state",0);
+            bmiControlLevelList.add(iJson);
+        }
+        bmiControl.put("details",bmiControlLevelList);
+        itemJson.add(bmiControl);
+
+        JSONObject bloodFatControl = new JSONObject();
+        bloodFatControl.put("controltype",0);
+        bloodFatControl.put("name","血脂控制情况");
+        List<JSONObject> bloodFatControlLevelList = new ArrayList<>();
+        String[] bloodFatControlitems= {"高血脂"};
+        for (String item:bloodFatControlitems) {
+            JSONObject iJson = new JSONObject();
+            iJson.put("detailName",item);
+            iJson.put("state",0);
+            bloodFatControlLevelList.add(iJson);
+        }
+        bloodFatControl.put("details",bmiControlLevelList);
+        itemJson.add(bloodFatControl);
         curativeJson.put("rows",itemJson);
+        //分级管理
+        JSONObject gradeJson = new JSONObject();
+
+
         mangementMap.put("疗效评估",curativeJson);
 
 
 
+
         mangementEvaluation.setMangementEvaluation(mangementMap);
         return mangementEvaluation;
     }