浏览代码

Merge remote-tracking branch 'origin/dev/KLBstand' into dev/KLBstand

gaodm 6 年之前
父节点
当前提交
d61dd1e776

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

@@ -1,14 +1,19 @@
 package com.diagbot.client;
 
+import com.diagbot.client.bean.CalculateData;
+import com.diagbot.client.bean.ScaleContent;
 import com.diagbot.client.bean.SearchData;
 import com.diagbot.client.hystrix.AiptServiceHystrix;
+import com.diagbot.dto.ConceptIntroduceDTO;
 import com.diagbot.dto.DisclaimerInformationDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.vo.ConceptIntroduceVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.validation.Valid;
 import java.util.List;
 import java.util.Map;
 
@@ -40,4 +45,31 @@ public interface AiptServiceClient {
 
     @PostMapping("/disclaimerInformation/getDisclaimerInformations")
     RespDTO<List<DisclaimerInformationDTO>> getDisclaimerInformations();
+
+    /**
+     * 计算接口-量表/公式
+     *
+     * @param calculateData
+     * @return
+     */
+    @PostMapping(value = "/clinicaldata/scaleCalc")
+    RespDTO<Map<String, Object>> scaleCalc(@RequestBody CalculateData calculateData);
+
+    /**
+     * 获取量表接口
+     *
+     * @param searchData
+     * @return
+     */
+    @PostMapping(value = "/clinicaldata/getScale")
+    RespDTO<List<ScaleContent>> getScale(@RequestBody SearchData searchData);
+
+    /**
+     * 获取提示信息
+     *
+     * @param conceptIntroduceVO
+     * @return
+     */
+    @PostMapping(value = "/conceptDetail/getConceptDetail")
+    RespDTO<ConceptIntroduceDTO> getConceptDetail(@Valid @RequestBody ConceptIntroduceVO conceptIntroduceVO);
 }

+ 17 - 0
data-service/src/main/java/com/diagbot/client/bean/CalculateData.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/24 15:15
+ */
+@Getter
+@Setter
+public class CalculateData {
+    private Integer type;  //1-量表,2-计算公式
+    private JSONObject data;
+}

+ 37 - 0
data-service/src/main/java/com/diagbot/client/bean/ScaleContent.java

@@ -0,0 +1,37 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 量表内容表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-11
+ */
+@Getter
+@Setter
+public class ScaleContent implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 量表概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 0:文本,1:大数据接口填充
+     */
+    private Integer type;
+
+}

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

@@ -1,14 +1,19 @@
 package com.diagbot.client.hystrix;
 
 import com.diagbot.client.AiptServiceClient;
+import com.diagbot.client.bean.CalculateData;
+import com.diagbot.client.bean.ScaleContent;
 import com.diagbot.client.bean.SearchData;
+import com.diagbot.dto.ConceptIntroduceDTO;
 import com.diagbot.dto.DisclaimerInformationDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.vo.ConceptIntroduceVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.validation.Valid;
 import java.util.List;
 import java.util.Map;
 
@@ -49,4 +54,40 @@ public class AiptServiceHystrix implements AiptServiceClient {
         log.error("【hystrix】调用{}异常", "getDisclaimerInformations");
         return null;
     }
+
+    /**
+     * 计算接口-量表/公式
+     *
+     * @param calculateData
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, Object>> scaleCalc(@RequestBody CalculateData calculateData) {
+        log.error("【hystrix】调用{}异常", "scaleCalc");
+        return null;
+    }
+
+    /**
+     * 获取量表接口
+     *
+     * @param searchData
+     * @return
+     */
+    @Override
+    public RespDTO<List<ScaleContent>> getScale(@RequestBody SearchData searchData) {
+        log.error("【hystrix】调用{}异常", "getScale");
+        return null;
+    }
+
+    /**
+     * 获取提示信息
+     *
+     * @param conceptIntroduceVO
+     * @return
+     */
+    @Override
+    public RespDTO<ConceptIntroduceDTO> getConceptDetail(@Valid @RequestBody ConceptIntroduceVO conceptIntroduceVO) {
+        log.error("【hystrix】调用{}异常", "getConceptDetail");
+        return null;
+    }
 }

+ 33 - 0
data-service/src/main/java/com/diagbot/dto/ConceptDetailDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:提示信息明细
+ * @Author:zhaops
+ * @time: 2019/5/6 16:33
+ */
+@Getter
+@Setter
+public class ConceptDetailDTO {
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 是否诊断依据(1-是,0-否)
+     */
+    private Integer isReason;
+}

+ 12 - 0
data-service/src/main/java/com/diagbot/dto/ConceptIntroduceDTO.java

@@ -0,0 +1,12 @@
+package com.diagbot.dto;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/13 20:24
+ */
+public class ConceptIntroduceDTO extends ConceptBaseDTO {
+    private List<ConceptDetailDTO> details;
+}

+ 28 - 0
data-service/src/main/java/com/diagbot/facade/CalculateFacade.java

@@ -0,0 +1,28 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.AiptServiceClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.CalculateVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/13 20:19
+ */
+@Component
+public class CalculateFacade {
+    @Autowired
+    AiptServiceClient aiptServiceClient;
+
+    public Map<String, Object> calculate(CalculateVO calculateVO) {
+        RespDTO<Map<String, Object>> res = aiptServiceClient.scaleCalc(calculateVO);
+        RespDTOUtil.respNGDealCover(res, "计算没有结果返回");
+        Map<String, Object> map = res.data;
+        return map;
+    }
+}

+ 15 - 0
data-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.diagbot.client.AiptServiceClient;
+import com.diagbot.client.bean.ScaleContent;
 import com.diagbot.client.bean.SearchData;
 import com.diagbot.dto.ConceptPushDTO;
 import com.diagbot.dto.PushDTO;
@@ -94,4 +95,18 @@ public class PushFacade {
         Map<String, Object> data = res.data;
         return data;
     }
+
+    /**
+     * 治疗方案推送-不包含慢病内容
+     *
+     * @param pushVO
+     * @return
+     */
+    public List<ScaleContent> pushScale(PushVO pushVO) {
+        SearchData searchData = assembleFacade.assembleData(pushVO);
+        RespDTO<List<ScaleContent>> res = aiptServiceClient.getScale(searchData);
+        RespDTOUtil.respNGDealCover(res, "中间层没有返回量表");
+        List<ScaleContent> data = res.data;
+        return data;
+    }
 }

+ 11 - 0
data-service/src/main/java/com/diagbot/vo/CalculateVO.java

@@ -0,0 +1,11 @@
+package com.diagbot.vo;
+
+import com.diagbot.client.bean.CalculateData;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/13 20:20
+ */
+public class CalculateVO extends CalculateData {
+}

+ 21 - 0
data-service/src/main/java/com/diagbot/vo/ConceptBaseVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/5/6 18:50
+ */
+@Getter
+@Setter
+public class ConceptBaseVO {
+    @NotBlank(message = "概念名称不能为空")
+    private String name;
+    @NotNull(message = "词性不能为空")
+    private Integer libType;
+}

+ 18 - 0
data-service/src/main/java/com/diagbot/vo/ConceptIntroduceVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:获取提示信息入参
+ * @Author:zhaops
+ * @time: 2019/5/6 15:43
+ */
+@Getter
+@Setter
+public class ConceptIntroduceVO extends ConceptBaseVO {
+    @NotNull(message = "请输入展示位置")
+    private Integer position;
+}

+ 36 - 0
data-service/src/main/java/com/diagbot/web/CalculateController.java

@@ -0,0 +1,36 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.CalculateFacade;
+import com.diagbot.vo.CalculateVO;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/13 20:15
+ */
+@RestController
+@RequestMapping("/calc")
+public class CalculateController {
+    @Autowired
+    CalculateFacade calculateFacade;
+
+    @ApiOperation(value = "推理结果计算接口[by:zhaops]",
+            notes = "type: 1-量表,2-计算公式(必填),Integer<br>" +
+                    "data:计算参数(量表或计算公式结构),String<br>")
+    @PostMapping("/calculate")
+    @SysLogger("calculate")
+    public RespDTO<Map<String, Object>> calculate(@RequestBody @Valid CalculateVO calculateVO) {
+        return RespDTO.onSuc(calculateFacade.calculate(calculateVO));
+    }
+}

+ 35 - 8
data-service/src/main/java/com/diagbot/web/PushController.java

@@ -45,15 +45,13 @@ public class PushController {
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
                     "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,22-指标,String<br>" +
-                    "diseaeId:取治疗方案的诊断,Long<br>" +
+                    "diseaseName:取治疗方案的诊断,String<br>" +
                     "scaleName:量表名称,String<br>" +
-                    "scaleId:量表id,Long<br>" +
-                    "patientId:病人id,Long<br>" +
                     "disType:诊断类型,1-慢病,2-急诊,普通病不填,Integer<br>" +
                     "indications:指标结果,String<br>" +
-                    "adverseReactions:不良反应,List<不良反应明细><br>")
-    @PostMapping("/pushInner")
-    @SysLogger("pushInner")
+                    "adverseReactions:不良反应,String<br>")
+    @PostMapping("/push")
+    @SysLogger("push")
     public RespDTO<PushDTO> push(@RequestBody @Valid PushVO pushVO) {
         return RespDTO.onSuc(pushFacade.push(pushVO));
     }
@@ -78,13 +76,42 @@ public class PushController {
                     "diag:诊断,String<br>" +
                     "featureType:类型(必填),8:治疗方案,String<br>" +
                     "diseaeName:取治疗方案的诊断,String<br>" +
-                    "patientId:病人id,Long<br>" +
                     "disType:诊断类型,1-慢病,2-急诊,普通病不填,Integer<br>" +
                     "indications:指标结果,String<br>" +
-                    "adverseReactions:不良反应,List<不良反应明细><br>")
+                    "adverseReactions:不良反应,String<br>")
     @PostMapping("/pushTreatment")
     @SysLogger("pushTreatment")
     public RespDTO<Map<String, Object>> pushTreatment(@RequestBody @Valid PushVO pushVO) {
         return RespDTO.onSuc(pushFacade.pushTreatment(pushVO));
     }
+
+    @ApiOperation(value = "知识库标准化-量表[by:zhaops]",
+            notes = "age: 年龄(必填)<br>" +
+                    "sex:性别(必填),1:男,2:女<br>" +
+                    "symptom:症状,String<br>" +
+                    "other:其它史,String<br>" +
+                    "vital:查体,String<br>" +
+                    "lis:化验,Array<br>" +
+                    "lis:name:套餐名称(必填),String<br>" +
+                    "lis:detailName:化验项名称(必填),String<br>" +
+                    "lis:uniqueName:公表名称,String<br>" +
+                    "lis:value:值,Double<br>" +
+                    "lis:maxValue:最大值,Double<br>" +
+                    "lis:minValue:最小值,Double<br>" +
+                    "lis:units:单位,String<br>" +
+                    "lis:otherValue:其他结果,包括阴性阳性,文字描述等,String<br>" +
+                    "lis:source:数据来源(必填),Integer<br>" +
+                    "pacs:辅检,String<br>" +
+                    "diag:诊断,String<br>" +
+                    "featureType:类型(必填),8:治疗方案,String<br>" +
+                    "diseaeName:取治疗方案的诊断,String<br>" +
+                    "scaleName:量表名称,String<br>" +
+                    "disType:诊断类型,1-慢病,2-急诊,普通病不填,Integer<br>" +
+                    "indications:指标结果,String<br>" +
+                    "adverseReactions:不良反应,String<br>")
+    @PostMapping("/pushScale")
+    @SysLogger("pushScale")
+    public RespDTO<Map<String, Object>> pushScale(@RequestBody @Valid PushVO pushVO) {
+        return RespDTO.onSuc(pushFacade.pushScale(pushVO));
+    }
 }