Browse Source

Merge branch 'dev/icssNCD' of http://192.168.2.236:10080/gaodm/diagbotcloud.git into dev/icssNCD

wangfeng 6 years atrás
parent
commit
d03fb1e203

+ 2 - 2
icss-service/src/main/java/com/diagbot/client/bean/AdverseReactionDetail.java

@@ -12,5 +12,5 @@ import lombok.Setter;
 @Setter
 public class AdverseReactionDetail {
     private String name;
-    private Integer isSelected; //是否选中:0-未选中,1-选中
-}
+    private Integer value; //是否选中:0-未选中,1-选中
+}

+ 16 - 0
icss-service/src/main/java/com/diagbot/client/bean/IndicationResult.java

@@ -0,0 +1,16 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/18 15:14
+ */
+@Getter
+@Setter
+public class IndicationResult {
+    private String name;
+    private String result;
+}

+ 37 - 2
icss-service/src/main/java/com/diagbot/client/bean/SearchData.java

@@ -27,7 +27,10 @@ public class SearchData {
     private String past = "";
     private String other = "";
     private List<LisResult> lisArr;
-
+    private Integer disType; //0-普通病(默认不填),1-慢病,2-急诊
+    private String scaleName;
+    private List<AdverseReaction> adverseEvent;
+    private List<IndicationResult> indications;
 
     //特征类别
     private String featureType;
@@ -268,4 +271,36 @@ public class SearchData {
     public void setLisArr(List<LisResult> lisArr) {
         this.lisArr = lisArr;
     }
-}
+
+    public Integer getDisType() {
+        return disType;
+    }
+
+    public void setDisType(Integer disType) {
+        this.disType = disType;
+    }
+
+    public String getScaleName() {
+        return scaleName;
+    }
+
+    public void setScaleName(String scaleName) {
+        this.scaleName = scaleName;
+    }
+
+    public List<AdverseReaction> getAdverseEvent() {
+        return adverseEvent;
+    }
+
+    public void setAdverseEvent(List<AdverseReaction> adverseEvent) {
+        this.adverseEvent = adverseEvent;
+    }
+
+    public List<IndicationResult> getIndications() {
+        return indications;
+    }
+
+    public void setIndications(List<IndicationResult> indications) {
+        this.indications = indications;
+    }
+}

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

@@ -1,6 +1,7 @@
 package com.diagbot.dto;
 
 import com.alibaba.fastjson.JSONObject;
+import com.diagbot.entity.ScaleContent;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -26,4 +27,5 @@ public class PushDTO {
     private Map<String, JSONObject> managementEvaluation;
     private Map<String, JSONObject> scale;
     private List<MedicalIndicationDTO> medicalIndications;
+    private List<ScaleContent> scaleContent;
 }

+ 22 - 5
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -18,6 +18,7 @@ import com.diagbot.dto.ScaleDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.entity.DeptVital;
 import com.diagbot.entity.QuestionInfo;
+import com.diagbot.entity.ScaleContent;
 import com.diagbot.enums.DisTypeEnum;
 import com.diagbot.enums.FeatureTypeEnum;
 import com.diagbot.enums.InputModeEnum;
@@ -75,6 +76,8 @@ public class PushFacade {
     private LisMappingFacade lisMappingFacade;
     @Autowired
     private DisTypeFacade disTypeFacade;
+    @Autowired
+    private ScaleContentFacade scaleContentFacade;
 
     /**
      * 推理接口
@@ -93,6 +96,10 @@ public class PushFacade {
         searchData.setPast(pushVO.getPast());
         searchData.setOther(pushVO.getOther());
         searchData.setDiag(pushVO.getDiag());
+        searchData.setDisType(pushVO.getDisType());
+        searchData.setAdverseEvent(pushVO.getAdverseReactions());
+        searchData.setScaleName(pushVO.getScaleName());
+        searchData.setIndications(pushVO.getMedicalIndications());
         switch (pushVO.getSex()) {
             case 1:
                 searchData.setSex("M");
@@ -132,6 +139,7 @@ public class PushFacade {
         if (null == res || null == res.getData()) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "AI没有返回结果");
         }
+        System.out.println(res.getData().getTreat());
         return res.getData();
     }
 
@@ -274,11 +282,17 @@ public class PushFacade {
                     "{\"name\":\"中度\",\"isSelected\":1},{\"name\":\"重度\",\"isSelected\":0}]}";
             JSONObject scaleJson = JSONObject.parseObject(scaleStr);
             scale = new LinkedHashMap<>();
-            scale.put("密西根糖尿病周围神经病筛查表", scaleJson);
+            scale.put("高血压量表1", scaleJson);
             pushDTO.setScale(scale);
+            String scaleContent = "";
+            if (scale.get(pushVO.getScaleName()) != null) {
+                scaleContent = scale.get(pushVO.getScaleName()).toJSONString();
+            }
+            List<ScaleContent> scaleContentList = scaleContentFacade.getContent(pushVO.getScaleId(), scaleContent);
+            pushDTO.setScaleContent(scaleContentList);
         }
 
-        //管理评估 featuretype=11 && disType=0(慢病)
+        //管理评估 featuretype=11 && disType=1(慢病)
         if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.ManagementEvaluation.getKey()))) {
             if (pushVO.getDisType().equals(DisTypeEnum.CHRONIC.getKey())) {
                 pushDTO.setManagementEvaluation(managementEvaluation);
@@ -550,9 +564,12 @@ public class PushFacade {
             }
         }
         PushDTO data = pushInner(pushVO, InputModeEnum.Structured.getKey());
-        Map<String, JSONObject> scaleMap = data.getScale();
-        scaleMap.get(pushVO.getScaleName()).toJSONString();
-        return scaleMap.get(pushVO.getScaleName()).toJSONString();
+        Map<String, JSONObject> scale = data.getScale();
+        String scaleContent = "";
+        if (scale.get(pushVO.getScaleName()) != null) {
+            scaleContent = scale.get(pushVO.getScaleName()).toJSONString();
+        }
+        return scaleContent;
     }
 
     /**

+ 3 - 7
icss-service/src/main/java/com/diagbot/facade/TreatmentFacade.java

@@ -2,10 +2,9 @@ package com.diagbot.facade;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.bean.AdverseReaction;
 import com.diagbot.client.bean.Medicition;
 import com.diagbot.client.bean.MedicitionClass;
-import com.diagbot.dto.QuestionDTO;
-import com.diagbot.entity.DisType;
 import com.diagbot.entity.InquiryDrug;
 import com.diagbot.entity.InquiryInfo;
 import com.diagbot.entity.IntroduceDetail;
@@ -17,13 +16,10 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
-import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.FastJsonUtils;
 import com.google.common.collect.Lists;
-import com.sun.org.apache.xpath.internal.operations.Bool;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.stereotype.Component;
 
 import java.util.LinkedHashMap;
@@ -138,8 +134,8 @@ public class TreatmentFacade {
             }
 
             //不良反应
-            retMap.put("adverseReactions", null);
-
+            List<AdverseReaction> adverseReactionList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "adverseEvent", AdverseReaction.class);
+            retMap.put("adverseReactions", adverseReactionList);
         }
         return retMap;
     }

+ 3 - 2
icss-service/src/main/java/com/diagbot/vo/PushVO.java

@@ -1,6 +1,7 @@
 package com.diagbot.vo;
 
 import com.diagbot.client.bean.AdverseReaction;
+import com.diagbot.client.bean.IndicationResult;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -33,7 +34,7 @@ public class PushVO {
     private Long patientId;   //病人id
     private String scaleName; //量表名称
     private Long scaleId;     //量表id
-    private Integer disType;  //0-慢病,1-急诊,普通病不填
+    private Integer disType;  //0-普通病(默认不填),1-慢病,2-急诊
     private List<AdverseReaction> adverseReactions; //不良反应
-    private List<MedicalIndicationVO> medicalIndications;   //推理指标
+    private List<IndicationResult> medicalIndications;   //推理指标
 }

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

@@ -56,8 +56,13 @@ public class PushController {
                     "lis:source:数据来源(必填),Integer<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
-                    "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案,String<br>" +
-                    "diseaeId:取治疗方案的诊断,Long<br>")
+                    "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案,11-管理评估,21-量表内容,22-指标,String<br>" +
+                    "diseaeId:取治疗方案的诊断,Long<br>" +
+                    "scaleName:量表名称,String<br>" +
+                    "scaleId:量表id,Long<br>" +
+                    "patientId:病人id,Long<br>" +
+                    "disType:诊断类型,1-慢病,2-急诊,普通病不填,Integer<br>" +
+                    "adverseReactions:不良反应,List<不良反应明细><br>")
     @PostMapping("/pushInner")
     @SysLogger("pushInner")
     public RespDTO<PushDTO> pushInner(@RequestBody @Valid PushVO pushVO) {
@@ -83,8 +88,13 @@ public class PushController {
                     "lis:source:数据来源(必填),Integer<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
-                    "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案,String<br>" +
-                    "diseaeId:取治疗方案的诊断,Long<br>")
+                    "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案,11-管理评估,21-量表内容,22-指标,String<br>" +
+                    "diseaeId:取治疗方案的诊断,Long<br>" +
+                    "scaleName:量表名称,String<br>" +
+                    "scaleId:量表id,Long<br>" +
+                    "patientId:病人id,Long<br>" +
+                    "disType:诊断类型,1-慢病,2-急诊,普通病不填,Integer<br>" +
+                    "adverseReactions:不良反应,List<不良反应明细><br>")
     @PostMapping("/pushText")
     @SysLogger("pushText")
     public RespDTO<PushDTO> pushText(@RequestBody @Valid PushVO pushVO) {
@@ -110,7 +120,7 @@ public class PushController {
                     "lis:source:数据来源(必填),Integer<br>" +
                     "pacs:辅检,String<br>" +
                     "dis:诊断<br>" +
-                    "featureType(必填):类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案,String<br>")
+                    "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案,11-管理评估,21-量表内容,22-指标,String<br>")
     @PostMapping("/pushAI")
     @SysLogger("pushAI")
     public RespDTO<ResponseData> pushAI(@RequestBody @Valid PushVO pushVO) {