Kaynağa Gözat

推理接口

Zhaops 6 yıl önce
ebeveyn
işleme
0d8ea2eb45

+ 19 - 0
icss-service/src/main/java/com/diagbot/dto/PushKYJDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import com.diagbot.client.bean.FeatureRate;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/26 17:23
+ */
+@Getter
+@Setter
+public class PushKYJDTO {
+    private List<FeatureRate> dis;
+    private List<FeatureRate> labs;
+}

+ 49 - 0
icss-service/src/main/java/com/diagbot/enums/QualitativeTypeEnum.java

@@ -0,0 +1,49 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/26 17:38
+ */
+public enum QualitativeTypeEnum implements KeyedNamed {
+    Negative(0, "阴性"),
+    Positive(1, "阳性");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    QualitativeTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static QualitativeTypeEnum getEnum(Integer key) {
+        for (QualitativeTypeEnum item : QualitativeTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        QualitativeTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 51 - 0
icss-service/src/main/java/com/diagbot/enums/QuantitativeTypeEnum.java

@@ -0,0 +1,51 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/26 17:42
+ */
+public enum  QuantitativeTypeEnum implements KeyedNamed {
+    Normal(0, "正常"),
+    Up(1, "升高"),
+    Down(2, "降低");
+
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    QuantitativeTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static QuantitativeTypeEnum getEnum(Integer key) {
+        for (QuantitativeTypeEnum item : QuantitativeTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        QuantitativeTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 33 - 0
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -7,6 +7,7 @@ import com.diagbot.client.bean.Response;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
 import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.PushKYJDTO;
 import com.diagbot.dto.QuestionDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.entity.DeptVital;
@@ -17,6 +18,8 @@ import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.util.EntityUtil;
+import com.diagbot.vo.LisKYJVO;
+import com.diagbot.vo.PushKYJVO;
 import com.diagbot.vo.PushVO;
 import com.diagbot.vo.QuestionVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -182,6 +185,36 @@ public class PushFacade {
         return pushDTO;
     }
 
+
+    /**
+     * 推理接口-快易检
+     * @param pushKYJVO
+     * @return
+     */
+    public PushKYJDTO pushKYJ(PushKYJVO pushKYJVO) {
+        PushVO pushVO = new PushVO();
+        pushVO.setAge(pushKYJVO.getAge());
+        pushVO.setSex(pushKYJVO.getSex());
+
+        //参数预处理
+        String lis="";
+        for(LisKYJVO lisKYJVO:pushKYJVO.getLisKYJVOList()){
+            String lisDetail="";
+            if(lisKYJVO.getValue()!=null){
+
+            }
+            if(lisKYJVO.getOtherValue()!=null){
+                
+            }
+        }
+
+        ResponseData responseData = pushAI(pushVO);
+        PushKYJDTO pushKYJDTO = new PushKYJDTO();
+        pushKYJDTO.setLabs(responseData.getLabs());
+        pushKYJDTO.setDis(responseData.getDis());
+        return pushKYJDTO;
+    }
+
     /**
      * 将list 转换成 map
      *

+ 23 - 0
icss-service/src/main/java/com/diagbot/vo/LisKYJVO.java

@@ -0,0 +1,23 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/26 17:04
+ */
+@Getter
+@Setter
+public class LisKYJVO {
+    private String name ;//名称
+    private Double value;//值
+    private Double max;//最大值
+    private Double min;//最小值
+    private String units;//单位
+    private Integer  multipleState;//状态 0 1 2
+    private String  multipleValue;//状态值
+    private Integer  negativeState;//状态 (阴形,阳性)
+    private String otherValue;//
+}

+ 22 - 0
icss-service/src/main/java/com/diagbot/vo/PushKYJVO.java

@@ -0,0 +1,22 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/26 17:05
+ */
+@Getter
+@Setter
+public class PushKYJVO {
+    @NotNull(message = "请输入年龄")
+    private Integer age;
+    @NotNull(message = "请输入性别")
+    private Integer sex;
+    private List<LisKYJVO> lisKYJVOList;
+}

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

@@ -3,8 +3,10 @@ package com.diagbot.web;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.PushKYJDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.PushFacade;
+import com.diagbot.vo.PushKYJVO;
 import com.diagbot.vo.PushVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -42,9 +44,19 @@ public class PushController {
     @ApiOperation(value = "推理接口(直接返回大数据推理结果)[by:zhaops]",
             notes = "age: 年龄(必填)<br>" +
                     "sex:性别,1:男,2:女(必填)<br>")
-    @PostMapping("/push_ai")
-    @SysLogger("push_ai")
+    @PostMapping("/pushAI")
+    @SysLogger("pushAI")
     public RespDTO<ResponseData> pushAI(@RequestBody @Valid PushVO pushVO) {
         return RespDTO.onSuc(pushFacade.pushAI(pushVO));
     }
-}
+
+    @ApiOperation(value = "推理接口(快易检)[by:zhaops]",
+            notes = "age: 年龄(必填)<br>" +
+                    "sex:性别,1:男,2:女(必填)<br>" +
+                    "lisKYJVOList:化验项列表(必填)<br>")
+    @PostMapping("/pushKYJ")
+    @SysLogger("pushKYJ")
+    public RespDTO<PushKYJDTO> pushKYJ(@RequestBody @Valid PushKYJVO pushKYJVO) {
+        return RespDTO.onSuc(pushFacade.pushKYJ(pushKYJVO));
+    }
+}