Browse Source

数据服务模式

Zhaops 6 years ago
parent
commit
2e9e9e9df6

+ 24 - 0
data-service/src/main/java/com/diagbot/client/AiptServiceClient.java

@@ -1,7 +1,14 @@
 package com.diagbot.client;
 
+import com.diagbot.client.bean.SearchData;
 import com.diagbot.client.hystrix.AiptServiceHystrix;
+import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.RespDTO;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.Map;
 
 /**
  * @Description: 调用知识库服务
@@ -11,4 +18,21 @@ import org.springframework.cloud.openfeign.FeignClient;
 @FeignClient(value = "aipt-service", fallback = AiptServiceHystrix.class)
 public interface AiptServiceClient {
 
+    /**
+     * 推理
+     *
+     * @param searchData
+     * @return
+     */
+    @PostMapping("/push/pushInner")
+    RespDTO<PushDTO> pushInner(@RequestBody SearchData searchData);
+
+    /**
+     * 获取治疗方案
+     *
+     * @param searchData
+     * @return
+     */
+    @PostMapping("/push/treatment")
+    RespDTO<Map<String, Object>> getTreatment(@RequestBody SearchData searchData);
 }

+ 26 - 0
data-service/src/main/java/com/diagbot/client/bean/LisResult.java

@@ -0,0 +1,26 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:化验信息
+ * @Author:zhaops
+ * @time: 2018/12/19 14:03
+ */
+@Getter
+@Setter
+public class LisResult {
+    private String name;//套餐名称
+    private String detailName;//化验项名称
+    private String uniqueName;//公表名称
+    private Double value;//值
+    private Double maxValue;//最大值
+    private Double minValue;//最小值
+    private String units;//单位
+    private String otherValue;//其他结果,包括阴性阳性,文字描述等
+    @NotNull(message = "请输入数据来源")
+    private Integer source;
+}

+ 21 - 0
data-service/src/main/java/com/diagbot/client/bean/MedicalIndication.java

@@ -0,0 +1,21 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+
+/**
+ * @Description:推送指标
+ * @Author:zhaops
+ * @time: 2019/3/14 14:40
+ */
+@Getter
+@Setter
+public class MedicalIndication {
+    private Long conceptId;
+    private Integer libType;
+    private String name;
+    private List<MedicalIndicationDetail> details;
+}

+ 17 - 0
data-service/src/main/java/com/diagbot/client/bean/MedicalIndicationDetail.java

@@ -0,0 +1,17 @@
+package com.diagbot.client.bean;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:推送指标明细
+ * @Author:zhaops
+ * @time: 2019/4/11 10:15
+ */
+@Getter
+@Setter
+public class MedicalIndicationDetail {
+    private Integer type; //1-量表,2-公式,3-其他指标
+    private JSONObject content;  //type<>1 非量表,返回内容;type=1 量表,返回量表名称{"name":""}
+}

+ 35 - 0
data-service/src/main/java/com/diagbot/client/bean/SearchData.java

@@ -0,0 +1,35 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * Created by fyeman on 2018/1/31.
+ */
+@Getter
+@Setter
+public class SearchData {
+    private int length;
+    private int age;
+    private String sex;
+    //特征类别
+    private String featureType;
+    //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
+    private String sysCode;
+    private String symptom;
+    private String past;
+    private String other;
+    private String vital;
+    private String lis;
+    private List<LisResult> lisArr;
+    private String pacs;
+    private String diag;
+    private String diseaseName; //指定诊断,例如取治疗方案
+    private String scaleName;   //量表名称
+    private String indications; //指标结果
+    private String adverseReactions; //不良反应
+    private Integer disType;    //诊断类型
+    private String adverseEvent;
+}

+ 29 - 0
data-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java

@@ -1,8 +1,14 @@
 package com.diagbot.client.hystrix;
 
 import com.diagbot.client.AiptServiceClient;
+import com.diagbot.client.bean.SearchData;
+import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.RespDTO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.Map;
 
 /**
  * @Description: 调用知识库服务
@@ -12,4 +18,27 @@ import org.springframework.stereotype.Component;
 @Component
 @Slf4j
 public class AiptServiceHystrix implements AiptServiceClient {
+    /**
+     * 推理
+     *
+     * @param searchData
+     * @return
+     */
+    @Override
+    public RespDTO<PushDTO> pushInner(@RequestBody SearchData searchData) {
+        log.error("【hystrix】调用{}异常", "pushInner");
+        return null;
+    }
+
+    /**
+     * 获取治疗方案
+     *
+     * @param searchData
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, Object>> getTreatment(@RequestBody SearchData searchData) {
+        log.error("【hystrix】调用{}异常", "getTreatment");
+        return null;
+    }
 }