Browse Source

推理增加其他史

Zhaops 6 years ago
parent
commit
59984e0b5f

+ 18 - 8
icss-service/src/main/java/com/diagbot/client/bean/ResponseData.java

@@ -16,18 +16,12 @@ public class ResponseData {
     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,String> treat;
 
-    public Map<String, String> getTreat() {
-        return treat;
-    }
-
-    public void setTreat(Map<String, String> treat) {
-        this.treat = treat;
-    }
-
     private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.5f);
 
+
     public String getParticipleSymptom() {
         return participleSymptom;
     }
@@ -76,6 +70,22 @@ public class ResponseData {
         this.pacs = pacs;
     }
 
+    public List<FeatureRate> getHistory() {
+        return history;
+    }
+
+    public void setHistory(List<FeatureRate> history) {
+        this.history = history;
+    }
+
+    public Map<String, String> getTreat() {
+        return treat;
+    }
+
+    public void setTreat(Map<String, String> treat) {
+        this.treat = treat;
+    }
+
     public Map<String, Map<String, String>> getInputs() {
         return inputs;
     }

+ 1 - 0
icss-service/src/main/java/com/diagbot/dto/PushDTO.java

@@ -15,6 +15,7 @@ import java.util.Map;
 @Setter
 public class PushDTO {
     private List<QuestionDTO> symptom;
+    private List<QuestionDTO> other;
     private List<QuestionDTO> vital;
     private List<QuestionDTO> lab;
     private List<QuestionDTO> pacs;

+ 29 - 20
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -121,21 +121,49 @@ public class PushFacade {
         List<FeatureRate> dis = data.getDis();
         List<FeatureRate> pacs = data.getPacs();
         List<FeatureRate> labs = data.getLabs();
+        List<FeatureRate> other = data.getHistory();
         Map<String, String> treat = data.getTreat();
 
         Map<String, Object> symptomMap = list2Map(symptom);
         Map<String, Object> labMap = list2Map(labs);
         Map<String, Object> pacsMap = list2Map(pacs);
+        Map<String, Object> otherMap = list2Map(other);
 
+        //症状 标签列表
+        if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Symptom.getKey()))) {
+            //文本模式不推症状,仅结构化模式推症状
+            //if (mode.equals(InputModeEnum.Structured.getKey())) {
+            List<QuestionDTO> symptomDTO = getTagListByMap(symptomMap, pushVO, QuestionTypeEnum.Symptom.getKey());
+            pushDTO.setSymptom(symptomDTO);
+            //}
+        }
+        //其他史 标签列表
+        if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Other.getKey()))) {
+            List<QuestionDTO> otherDTO = getTagListByMap(otherMap, pushVO, QuestionTypeEnum.Other.getKey());
+            pushDTO.setOther(otherDTO);
+        }
+        //查体 返回模板(标签列表)
+        if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Vital.getKey()))) {
+            //没有推送信息时,默认取全科模板
+            String deptName = "全科";
+            if (dis != null && dis.size() > 0) {
+                deptName = dis.get(0).getExtraProperty();
+            }
+            List<QuestionDTO> vitalDTO = getVitalModule(deptName, pushVO);
+            pushDTO.setVital(vitalDTO);
+
+        }
+        //化验  标签列表
         if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Lis.getKey()))) {
             List<QuestionDTO> labDTO = getTagListByMap(labMap, pushVO, QuestionTypeEnum.Lis.getKey());
             pushDTO.setLab(labDTO);
         }
+        //辅检  标签列表
         if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Pacs.getKey()))) {
             List<QuestionDTO> pacsDTO = getTagListByMap(pacsMap, pushVO, QuestionTypeEnum.Pacs.getKey());
             pushDTO.setPacs(pacsDTO);
         }
-        //诊断 返回tagName+标签
+        //诊断 返回分类+标签列表
         if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Disease.getKey()))) {
             Map<String, List<QuestionDTO>> disMapDTO = new LinkedHashMap<>();
             Map<String, List<FeatureRate>> disFeatureMap = new LinkedHashMap<>();
@@ -180,25 +208,6 @@ public class PushFacade {
             }
             pushDTO.setDis(disMapDTO);
         }
-        //症状(主诉 type=1;现病史 type=2) 返回 tagName+填写单
-        if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Symptom.getKey()))) {
-            //文本模式不推症状,仅结构化模式推症状
-            if (mode.equals(InputModeEnum.Structured.getKey())) {
-                List<QuestionDTO> symptomDTO = getTagListByMap(symptomMap, pushVO, QuestionTypeEnum.Symptom.getKey());
-                pushDTO.setSymptom(symptomDTO);
-            }
-        }
-        //查体 返回模板
-        if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Vital.getKey()))) {
-            //没有推送信息时,默认取全科模板
-            String deptName = "全科";
-            if (dis != null && dis.size() > 0) {
-                deptName = dis.get(0).getExtraProperty();
-            }
-            List<QuestionDTO> vitalDTO = getVitalModule(deptName, pushVO);
-            pushDTO.setVital(vitalDTO);
-
-        }
         //治疗方案
         if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Drug.getKey()))) {
             if (pushVO.getDiseaseId() == null) {

+ 3 - 3
icss-service/src/main/java/com/diagbot/web/PushController.java

@@ -42,7 +42,7 @@ public class PushController {
                     "lis:化验,Array<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
-                    "featureType:类型,1:症状,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>"+
+                    "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>"+
                     "diseaeId:取治疗方案的诊断,Long<br>" )
     @PostMapping("/pushInner")
     @SysLogger("pushInner")
@@ -59,7 +59,7 @@ public class PushController {
                     "lis:化验,Array<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
-                    "featureType:类型,1:症状,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>"+
+                    "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>"+
                     "diseaeId:取治疗方案的诊断,Long<br>" )
     @PostMapping("/pushText")
     @SysLogger("pushText")
@@ -76,7 +76,7 @@ public class PushController {
                     "lis:化验,Array<br>" +
                     "pacs:辅检,String<br>" +
                     "dis:诊断<br>" +
-                    "featureType:类型,1:症状,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填)<br>")
+                    "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填)<br>")
     @PostMapping("/pushAI")
     @SysLogger("pushAI")
     public RespDTO<ResponseData> pushAI(@RequestBody @Valid PushVO pushVO) {