浏览代码

Merge remote-tracking branch 'origin/master'

MarkHuang 4 年之前
父节点
当前提交
007a2f000f

+ 2 - 6
src/main/java/com/diagbot/dto/WordCrfDTO.java

@@ -22,13 +22,9 @@ public class WordCrfDTO {
     private Integer age;
     // 性别(1:男,2:女)
     private Integer sex;
-    /**
-     * 化验项目和结果
-     */
+    // 化验项目和结果
     private List<Lis> lis = new ArrayList<>();
-    /**
-     * 辅检项目和结果
-     */
+    // 辅检项目和结果
     private List<Pacs> pacs = new ArrayList<>();
     // 主诉
     private ChiefLabel chiefLabel;

+ 7 - 5
src/main/java/com/diagbot/process/BillProcess.java

@@ -17,6 +17,7 @@ import com.diagbot.rule.DiagRule;
 import com.diagbot.rule.LisPacsRule;
 import com.diagbot.rule.SexRule;
 import com.diagbot.util.CoreUtil;
+import com.diagbot.util.ListUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -74,15 +75,16 @@ public class BillProcess {
         DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
         ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
         PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
-        List<Diag> diags =null;
-        List<Clinical> clinicals =null;
+        List<Diag> diags = new ArrayList<>();
+        List<Clinical> clinicals = new ArrayList<>();
         if(diagLabel != null){
             diags = diagLabel.getDiags();
         }
-        if(chiefLabel != null){
+        if(chiefLabel != null && ListUtil.isNotEmpty(chiefLabel.getClinicals())){
             clinicals.addAll(chiefLabel.getClinicals());
         }
-        if(presentLabel != null){
+        // 现病史临床表现数据先不用
+        if(presentLabel != null && ListUtil.isNotEmpty(presentLabel.getClinicals())){
             clinicals.addAll(presentLabel.getClinicals());
         }
         List<Lis> lis = wordCrfDTO.getLis();
@@ -104,7 +106,7 @@ public class BillProcess {
             CoreUtil.addBeanToList(drugBill, lisMsg);
 
             //辅检
-            BillMsg pacsMsg = LisPacsRule.compareLisPacsWithBill(drug.getPACS(), pacs, bill.getName());
+            BillMsg pacsMsg = LisPacsRule.compareLisPacsWithBill(drug.getPacs(), pacs, bill.getName());
             CoreUtil.addBeanToList(drugBill, pacsMsg);
 
             //临床表现

+ 1 - 6
src/main/java/com/diagbot/rule/DiagRule.java

@@ -1,16 +1,11 @@
 package com.diagbot.rule;
 
 import com.diagbot.dto.BillMsg;
-import com.diagbot.dto.WordCrfDTO;
-import com.diagbot.model.entity.Diag;
 import com.diagbot.model.entity.Negative;
-import com.diagbot.model.label.DiagLabel;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.ListUtil;
 import org.apache.commons.lang3.StringUtils;
 
-import java.lang.annotation.Native;
-import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -31,7 +26,7 @@ public class DiagRule {
         List<String> reports = new ArrayList<>();
         if(inputLises != null && ListUtil.isNotEmpty(inputLises)){
             for (T d:inputLises) {
-                Negative val = (Negative)CoreUtil.getFieldValue(d, "Negative");
+                Negative val = (Negative)CoreUtil.getFieldValue(d, "negative");
                 if(val == null){
                     String c = (String) CoreUtil.getFieldValue(d, "standName");
                     String c_name = (String) CoreUtil.getFieldValue(d, "name");

+ 16 - 13
src/main/java/com/diagbot/util/CoreUtil.java

@@ -2,6 +2,7 @@ package com.diagbot.util;
 
 import com.diagbot.dto.BillMsg;
 import com.diagbot.model.entity.Clinical;
+import org.apache.commons.lang.StringUtils;
 
 import java.lang.reflect.Field;
 import java.util.ArrayList;
@@ -203,10 +204,11 @@ public class CoreUtil {
      * @param <T>
      */
     public static <T> void addBeanToList(List<T> list, T t) {
-        if (ListUtil.isNotEmpty(list)) {
-            if (t != null) {
-                list.add(t);
-            }
+        if (list == null) {
+            list = new ArrayList<T>();
+        }
+        if (t != null) {
+            list.add(t);
         }
     }
 
@@ -216,15 +218,16 @@ public class CoreUtil {
      * @return
      */
     public static  String listConvertString(List<String> list){
-        String message = "";
-        for(int i=0;i<list.size();i++){
-            if(i != list.size()-1){
-                message += list.get(i)+",";
-            }else {
-                message += i;
-            }
-        }
-        return message;
+        return StringUtils.join(list, ",");
+        // String message = "";
+        // for(int i=0;i<list.size();i++){
+        //     if(i != list.size()-1){
+        //         message += list.get(i)+",";
+        //     }else {
+        //         message += list.get(i);
+        //     }
+        // }
+        // return message;
     }
 
     public static void main(String[] args) {