Browse Source

Merge remote-tracking branch 'origin/push-grade' into push-debug

kongwz 6 years ago
parent
commit
a06e814798

+ 2 - 2
common-push/src/main/java/org/diagbot/common/push/cache/CacheFileManager.java

@@ -29,8 +29,8 @@ public class CacheFileManager {
 
     public static void main(String[] args) {
         CacheFileManager cacheFileManager = new CacheFileManager();
-        String p = cacheFileManager.getClass().getClassLoader().getResource("").getPath();
-        p = "d:/cache_file/";
+        PropertiesUtil propertiesUtil = new PropertiesUtil("nlp.properties");
+        String p = propertiesUtil.getProperty("cache.file.dir");
         File file = new File(p);
         if (!file.exists()) {
             file.mkdirs();

+ 0 - 17
common-service/src/main/java/org/diagbot/common/javabean/MedicalIndication.java

@@ -8,8 +8,6 @@ import java.util.List;
 public class MedicalIndication {
     private String name;
     private String rule;
-    private String description; //规则解释
-    private Integer source;//1 诊断依据推理, 2 危急值推理
     private List<MedicalIndicationDetail> details;
 
     public String getName() {
@@ -34,19 +32,4 @@ public class MedicalIndication {
         this.details = details;
     }
 
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public Integer getSource() {
-        return source;
-    }
-
-    public void setSource(Integer source) {
-        this.source = source;
-    }
 }

+ 1 - 1
common-service/src/main/java/org/diagbot/common/javabean/MedicalIndicationDetail.java

@@ -3,7 +3,7 @@ package org.diagbot.common.javabean;
 import com.alibaba.fastjson.JSONObject;
 
 public class MedicalIndicationDetail {
-    private Integer type;//1-量表,2-公式,3-其他指标
+    private Integer type;//1-量表,2-公式,3-其他指标,4-危急值
     private JSONObject content;
 
     public Integer getType() {

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

@@ -1604,7 +1604,6 @@ public class Neo4jAPI {
                 MedicalIndication medicalIndication = new MedicalIndication();
                 List<MedicalIndicationDetail> medicalIndicationDetailList = new ArrayList<>();
                 medicalIndication.setName(s);
-                medicalIndication.setSource(1);
                 MedicalIndicationDetail medicalIndicationDetail1 = null;
                 MedicalIndicationDetail medicalIndicationDetail2 = null;
                 MedicalIndicationDetail medicalIndicationDetail3 = null;

+ 0 - 1
push-web/src/main/java/org/diagbot/push/controller/AlgorithmController.java

@@ -160,7 +160,6 @@ public class AlgorithmController extends BaseController {
         searchData.setPushDiags(pushDiags);
         bigDataResponseData.setTreat(graphResponseData.getTreat());
         //量表和指标推送
-        List<MedicalIndication> ruleMedicalIndications = RuleResponseData.getMedicalIndications();
         List<MedicalIndication> medicalIndications = graphResponseData.getMedicalIndications();
         if (medicalIndications != null && medicalIndications.size() > 0) {
             logger.info("指标推送!!!!!!!!!");

+ 25 - 4
push-web/src/main/java/org/diagbot/push/convert/PreProcess.java

@@ -1,7 +1,9 @@
 package org.diagbot.push.convert;
 
+import com.alibaba.fastjson.JSONObject;
 import org.diagbot.bigdata.common.ApplicationCacheUtil;
 import org.diagbot.common.javabean.MedicalIndication;
+import org.diagbot.common.javabean.MedicalIndicationDetail;
 import org.diagbot.common.javabean.Rule;
 import org.diagbot.common.work.LisDetail;
 import org.diagbot.common.work.ResponseData;
@@ -194,9 +196,17 @@ public class PreProcess {
                 for (Rule rule : rules) {
                     if (rule.getMin_operator().equals("=") && otherval.contains(rule.getMin_value())) {
                         MedicalIndication medind = new MedicalIndication();
-                        medind.setSource(2);
+                        List<MedicalIndicationDetail> k = new ArrayList<>();
+                        MedicalIndicationDetail mid = new MedicalIndicationDetail();
+                        JSONObject jsonObject = new JSONObject();
+//                        jsonObject.put("name",detailname + ": " + otherval+ ", " +rule.getRemind());
+                        jsonObject.put("name",otherval);
+                        jsonObject.put("controlType",2);
+                        mid.setType(4);
+                        mid.setContent(jsonObject);
+                        k.add(mid);
                         medind.setName(rule.getRemind());
-                        medind.setDescription(detailname + ": " + otherval+ ", " +rule.getRemind() );
+                        medind.setDetails(k);
                         reminder.add(medind);
 
                         System.out.println(medind.getRule() + " -> " + medind.getName());
@@ -236,9 +246,17 @@ public class PreProcess {
 
                     if (minmatch && maxmatch) {
                         MedicalIndication medind = new MedicalIndication();
-                        medind.setSource(2);
+                        List<MedicalIndicationDetail> k = new ArrayList<>();
+                        MedicalIndicationDetail mid = new MedicalIndicationDetail();
+                        JSONObject jsonObject = new JSONObject();
+//                        jsonObject.put("name",detailname + ": " + numval + " " + unit+ "," +rule.getRemind());
+                        jsonObject.put("name", numval + " " + unit);
+                        jsonObject.put("controlType",2);
+                        mid.setType(4);
+                        mid.setContent(jsonObject);
+                        k.add(mid);
                         medind.setName(rule.getRemind());
-                        medind.setDescription(detailname + ": " + numval + " " + unit+ "," +rule.getRemind());
+                        medind.setDetails(k);
                         reminder.add(medind);
 
                         System.out.println(medind.getRule() + " -> " + medind.getName());
@@ -254,6 +272,9 @@ public class PreProcess {
     }
 
     private List<LisDetail> processLis(List<LisDetail> lisArr) {
+        if (lisArr == null) {
+            return new ArrayList<>();
+        }
         if (lisArr.size() == 0) {
             return lisArr;
         }