Browse Source

Merge remote-tracking branch 'origin/master' into innerDevelop

kongwz 4 năm trước cách đây
mục cha
commit
1a5255eaff
27 tập tin đã thay đổi với 1191 bổ sung53 xóa
  1. 26 0
      src/main/java/com/diagbot/client/IcssPushServiceClient.java
  2. 19 0
      src/main/java/com/diagbot/client/hystrix/IcssPushServiceHystrix.java
  3. 3 8
      src/main/java/com/diagbot/config/CacheDeleteInit.java
  4. 52 0
      src/main/java/com/diagbot/dto/icss/FeatureRate.java
  5. 174 0
      src/main/java/com/diagbot/dto/icss/Response.java
  6. 140 0
      src/main/java/com/diagbot/dto/icss/ResponseData.java
  7. 131 0
      src/main/java/com/diagbot/dto/icss/Status.java
  8. 62 0
      src/main/java/com/diagbot/entity/GraphDiseaseCorresponding.java
  9. 24 0
      src/main/java/com/diagbot/entity/PreResult.java
  10. 41 0
      src/main/java/com/diagbot/entity/Rule.java
  11. 1 0
      src/main/java/com/diagbot/enums/RedisEnum.java
  12. 10 0
      src/main/java/com/diagbot/facade/CacheFacade.java
  13. 19 16
      src/main/java/com/diagbot/facade/NeoFacade.java
  14. 16 0
      src/main/java/com/diagbot/facade/PushFacade.java
  15. 16 0
      src/main/java/com/diagbot/mapper/GraphDiseaseCorrespondingMapper.java
  16. 121 27
      src/main/java/com/diagbot/process/PushProcess.java
  17. 16 0
      src/main/java/com/diagbot/service/GraphDiseaseCorrespondingService.java
  18. 20 0
      src/main/java/com/diagbot/service/impl/GraphDiseaseCorrespondingServiceImpl.java
  19. 159 0
      src/main/java/com/diagbot/util/Constants.java
  20. 113 0
      src/main/java/com/diagbot/vo/IcssVo.java
  21. 1 0
      src/main/java/com/diagbot/web/CacheController.java
  22. 3 2
      src/main/java/com/diagbot/web/CoreController.java
  23. 3 0
      src/main/resources/application-local.yml
  24. 3 0
      src/main/resources/application-pre.yml
  25. 3 0
      src/main/resources/application-pro.yml
  26. 3 0
      src/main/resources/application-test.yml
  27. 12 0
      src/main/resources/mapper/GraphDiseaseCorrespondingMapper.xml

+ 26 - 0
src/main/java/com/diagbot/client/IcssPushServiceClient.java

@@ -0,0 +1,26 @@
+package com.diagbot.client;
+
+
+import com.diagbot.client.hystrix.IcssPushServiceHystrix;
+import com.diagbot.dto.icss.Response;
+import com.diagbot.dto.icss.ResponseData;
+import com.diagbot.vo.IcssVo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+
+/**
+ * @Description: ICSS5.0推送
+ * @author: Mark Huang
+ * @time: 2019/12/13 9:52
+ */
+@FeignClient(value = "IcssPush-service", url="${IcssPush.url}", fallback = IcssPushServiceHystrix.class)
+public interface IcssPushServiceClient {
+
+    @PostMapping(value = "/push-web/algorithm/neural")
+    Response<ResponseData> getAnnotation(@RequestBody IcssVo searchData);
+}
+
+
+

+ 19 - 0
src/main/java/com/diagbot/client/hystrix/IcssPushServiceHystrix.java

@@ -0,0 +1,19 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.IcssPushServiceClient;
+import com.diagbot.dto.icss.Response;
+import com.diagbot.dto.icss.ResponseData;
+import com.diagbot.vo.IcssVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@Component
+@Slf4j
+public class IcssPushServiceHystrix implements IcssPushServiceClient {
+    @Override
+    public Response<ResponseData> getAnnotation(@RequestBody IcssVo searchData) {
+        log.error("【hystrix】调用{}异常", "CRF-getAnnotation");
+        return null;
+    }
+}

+ 3 - 8
src/main/java/com/diagbot/config/CacheDeleteInit.java

@@ -41,6 +41,9 @@ public class CacheDeleteInit implements CommandLineRunner {
         cacheFacade.getSymptomFeatureCache();
         log.info("CDSS-CORE服务启动加载症状特征缓存成功!");
 
+        cacheFacade.getDiseaseCorrespondCache();
+        log.info("CDSS-CORE服务启动加载疾病对应缓存成功!");
+
         cacheFacade.getSymptomMainCache();
         log.info("CDSS-CORE服务启动加载典型症状缓存成功!");
 
@@ -50,14 +53,6 @@ public class CacheDeleteInit implements CommandLineRunner {
         cacheFacade.getSymptomNumCache();
         log.info("CDSS-CORE服务启动加载疾病对应的症状个数缓存成功!");
 
-        /*neoFacade.getDisSexCache();
-        log.info("CDSS-CORE服务启动加载图谱疾病对应性别信息缓存成功!");
-
-        neoFacade.getDisAgeCache();
-        log.info("CDSS-CORE服务启动加载图谱疾病对应年龄信息缓存成功!");
-
-        neoFacade.getDisdistributionCache();
-        log.info("CDSS-CORE服务启动加载图谱疾病对应发病率缓存成功!");*/
 
         log.info("CDSS-CORE初始化完成!");
     }

+ 52 - 0
src/main/java/com/diagbot/dto/icss/FeatureRate.java

@@ -0,0 +1,52 @@
+package com.diagbot.dto.icss;
+
+/**
+ * Created by fyeman on 2018/1/17.
+ */
+public class FeatureRate {
+    private String featureName;
+    private String extraProperty;
+    private String desc;
+    private String rate;
+    private String source;
+
+    public String getFeatureName() {
+        return featureName;
+    }
+
+    public void setFeatureName(String featureName) {
+        this.featureName = featureName;
+    }
+
+    public String getRate() {
+        return rate;
+    }
+
+    public void setRate(String rate) {
+        this.rate = rate;
+    }
+
+    public String getExtraProperty() {
+        return extraProperty;
+    }
+
+    public void setExtraProperty(String extraProperty) {
+        this.extraProperty = extraProperty;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    public String getSource() {
+        return source;
+    }
+
+    public void setSource(String source) {
+        this.source = source;
+    }
+}

+ 174 - 0
src/main/java/com/diagbot/dto/icss/Response.java

@@ -0,0 +1,174 @@
+package com.diagbot.dto.icss;
+
+import com.diagbot.util.Constants;
+
+/**
+ * @author kwz
+ * @date 2020/11/12
+ * @time 10:48
+ */
+public class Response <T> implements java.io.Serializable{
+    private static final long serialVersionUID = 8206448610408409499L;
+    private Status status =  Status.PENDING;  //状态
+    private long startTime = Constants.INVALIDATE_VALUE;                                  //起始时间
+    private long endTime = Constants.INVALIDATE_VALUE;                                    //结束时间
+    private String version="1.0";
+    private String msg = Constants.MSG_SUCCESS;                                  //消息
+    private T data = null;                                                                //序列化后的结果数据
+    // 返回结果标志,默认成功0,失败 1 参数错误 -1 token丢失-2
+    private int ret = Constants.RET_SUCCESS;
+
+    private String token;
+    //耗时
+    private long timeConsum;
+
+    public int getRet() {
+        return ret;
+    }
+
+    public void setRet(int ret) {
+        this.ret = ret;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public long getTimeConsum() {
+        return timeConsum;
+    }
+
+    public void setTimeConsum(long timeConsum) {
+        this.timeConsum = timeConsum;
+    }
+
+    public Response(){
+        super();
+    }
+
+    public Status getStatus() {
+        return status;
+    }
+
+    /**
+     * 在调用end()方法时,会自动设置状态,因此,如果调用了end()方法,就不要调用这个方法
+     * @param status
+     */
+    public Response<T> setStatus(Status status) {
+        this.status = status;
+        return this;
+    }
+
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public long getStartTime() {
+        return startTime;
+    }
+
+    public Response<T> setStartTime(long startTime) {
+        this.startTime = startTime;
+        return this;
+    }
+
+    public long getEndTime() {
+        return endTime;
+    }
+
+    public Response<T> setEndTime(long endTime) {
+        this.endTime = endTime;
+        return this;
+    }
+
+    public T getData() {
+        return data;
+    }
+
+    public void setData(T data) {
+        this.data = data;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    /**
+     * 设置状态和起始时间,表示操作正在进行
+     */
+    public Response<T> start(){
+        this.setStatus(Status.RUNNING);
+        this.setStartTime(System.currentTimeMillis());
+        return this;
+    }
+
+    /**
+     * 设置状态和时间,表示操作结束,没有失败
+     */
+    public Response<T> end(){
+        this.setEndTime(System.currentTimeMillis());
+        this.setTimeConsum(this.endTime-this.startTime);
+        this.setStatus(Status.OK);
+        return this;
+    }
+
+    /**
+     * 设置状态和时间,表示操作结束,并且失败
+     */
+    public Response<T> endAndFailed(){
+        this.setStatus(Status.FAIL);
+        this.setEndTime(System.currentTimeMillis());
+        return this;
+    }
+
+    /**
+     * 非参数错误通用失败信息
+     */
+    public Response<T> failure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_FAIL;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 参数错误信息
+     */
+    public Response<T> paramFailure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_ERROR_PARAM;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 用户信息丢失
+     */
+    public Response<T> tokenFailure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_NO_TOKEN;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 通用成功
+     */
+    public Response<T> success() {
+        this.end();
+        return this;
+    }
+}

+ 140 - 0
src/main/java/com/diagbot/dto/icss/ResponseData.java

@@ -0,0 +1,140 @@
+package com.diagbot.dto.icss;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by fyeman on 2018/2/2.
+ */
+public class ResponseData {
+    private String participleSymptom = "";
+
+    private List<FeatureRate> symptom = new ArrayList<>(10);
+    private List<FeatureRate> vitals = new ArrayList<>(10);
+    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 List<FeatureRate> beforeCombineDis = new ArrayList<>(10);
+
+//    private Map<String, Filnlly> treat = new HashMap<>();
+
+//    private Map<String,JSONObject> managementEvaluation; //管理评估
+    private Map managementEvaluation;
+    private List<String> diffDiag;//鉴别诊断
+    private List<String> excludeDiag; //排除诊断
+    private String hasIndications = "0";  //是否有病情提示标识 包括危急值 开单合理项 默认无
+
+
+    public List<String> getDiffDiag() {
+        return diffDiag;
+    }
+
+    public void setDiffDiag(List<String> diffDiag) {
+        this.diffDiag = diffDiag;
+    }
+
+    public List<String> getExcludeDiag() {
+        return excludeDiag;
+    }
+
+    public void setExcludeDiag(List<String> excludeDiag) {
+        this.excludeDiag = excludeDiag;
+    }
+
+    public Map getManagementEvaluation() {
+        return managementEvaluation;
+    }
+
+    public void setManagementEvaluation(Map managementEvaluation) {
+        this.managementEvaluation = managementEvaluation;
+    }
+
+
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10,0.5f);
+
+    public String getParticipleSymptom() {
+        return participleSymptom;
+    }
+
+    public void setParticipleSymptom(String participleSymptom) {
+        this.participleSymptom = participleSymptom;
+    }
+
+    public List<FeatureRate> getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(List<FeatureRate> symptom) {
+        this.symptom = symptom;
+    }
+
+    public List<FeatureRate> getVitals() {
+        return vitals;
+    }
+
+    public void setVitals(List<FeatureRate> vitals) {
+        this.vitals = vitals;
+    }
+
+    public List<FeatureRate> getDis() {
+        return dis;
+    }
+
+    public void setDis(List<FeatureRate> dis) {
+        this.dis = dis;
+    }
+
+    public List<FeatureRate> getLabs() {
+        return labs;
+    }
+
+    public void setLabs(List<FeatureRate> labs) {
+        this.labs = labs;
+    }
+
+    public List<FeatureRate> getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(List<FeatureRate> pacs) {
+        this.pacs = pacs;
+    }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+
+
+    public List<FeatureRate> getHistory() {
+        return history;
+    }
+
+    public void setHistory(List<FeatureRate> history) {
+        this.history = history;
+    }
+
+    public List<FeatureRate> getBeforeCombineDis() {
+        return beforeCombineDis;
+    }
+
+    public void setBeforeCombineDis(List<FeatureRate> beforeCombineDis) {
+        this.beforeCombineDis = beforeCombineDis;
+    }
+
+
+    public String getHasIndications() {
+        return hasIndications;
+    }
+
+    public void setHasIndications(String hasIndications) {
+        this.hasIndications = hasIndications;
+    }
+}

+ 131 - 0
src/main/java/com/diagbot/dto/icss/Status.java

@@ -0,0 +1,131 @@
+package com.diagbot.dto.icss;
+
+public enum Status {
+	/**
+	 * <code>PENDING = 1;</code>
+	 *
+	 * <pre>
+	 * 操作尚未开始
+	 * </pre>
+	 */
+	PENDING(1),
+	/**
+	 * <code>RUNNING = 2;</code>
+	 *
+	 * <pre>
+	 * 操作开始
+	 * </pre>
+	 */
+	RUNNING(2),
+	/**
+	 * <code>OK = 3;</code>
+	 *
+	 * <pre>
+	 * 操作正常结束
+	 * </pre>
+	 */
+	OK(3),
+	/**
+	 * <code>WARN = 4;</code>
+	 *
+	 * <pre>
+	 * 有警告,但是正常结束
+	 * </pre>
+	 */
+	WARN(4),
+	/**
+	 * <code>ERROR = 5;</code>
+	 *
+	 * <pre>
+	 * 有错误,但是完整结束
+	 * </pre>
+	 */
+	ERROR(5),
+	/**
+	 * <code>FAIL = 6;</code>
+	 *
+	 * <pre>
+	 * 操作失败
+	 * </pre>
+	 */
+	FAIL(6), ;
+
+	/**
+	 * <code>PENDING = 1;</code>
+	 *
+	 * <pre>
+	 * 操作尚未开始
+	 * </pre>
+	 */
+	public static final int PENDING_VALUE = 1;
+	/**
+	 * <code>RUNNING = 2;</code>
+	 *
+	 * <pre>
+	 * 操作开始
+	 * </pre>
+	 */
+	public static final int RUNNING_VALUE = 2;
+	/**
+	 * <code>OK = 3;</code>
+	 *
+	 * <pre>
+	 * 操作正常结束
+	 * </pre>
+	 */
+	public static final int OK_VALUE = 3;
+	/**
+	 * <code>WARN = 4;</code>
+	 *
+	 * <pre>
+	 * 有警告,但是正常结束
+	 * </pre>
+	 */
+	public static final int WARN_VALUE = 4;
+	/**
+	 * <code>ERROR = 5;</code>
+	 *
+	 * <pre>
+	 * 有错误,但是完整结束
+	 * </pre>
+	 */
+	public static final int ERROR_VALUE = 5;
+	/**
+	 * <code>FAIL = 6;</code>
+	 *
+	 * <pre>
+	 * 操作失败
+	 * </pre>
+	 */
+	public static final int FAIL_VALUE = 6;
+
+	public final int getNumber() {
+		return value;
+	}
+
+	public static Status valueOf(int value) {
+		switch (value) {
+		case 1:
+			return PENDING;
+		case 2:
+			return RUNNING;
+		case 3:
+			return OK;
+		case 4:
+			return WARN;
+		case 5:
+			return ERROR;
+		case 6:
+			return FAIL;
+		default:
+			return null;
+		}
+	}
+
+	private final int value;
+
+	private Status(int value) {
+		this.value = value;
+	}
+
+}

+ 62 - 0
src/main/java/com/diagbot/entity/GraphDiseaseCorresponding.java

@@ -0,0 +1,62 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-11-13
+ */
+public class GraphDiseaseCorresponding implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 平安诊断
+     */
+    private String diagPingan;
+
+    /**
+     * 对应的ICD10疾病
+     */
+    private String diagIcd;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+    public String getDiagPingan() {
+        return diagPingan;
+    }
+
+    public void setDiagPingan(String diagPingan) {
+        this.diagPingan = diagPingan;
+    }
+    public String getDiagIcd() {
+        return diagIcd;
+    }
+
+    public void setDiagIcd(String diagIcd) {
+        this.diagIcd = diagIcd;
+    }
+
+    @Override
+    public String toString() {
+        return "GraphDiseaseCorresponding{" +
+            "id=" + id +
+            ", diagPingan=" + diagPingan +
+            ", diagIcd=" + diagIcd +
+        "}";
+    }
+}

+ 24 - 0
src/main/java/com/diagbot/entity/PreResult.java

@@ -0,0 +1,24 @@
+package com.diagbot.entity;
+
+import lombok.Data;
+
+/**
+ * @author kwz
+ * @date 2020/11/12
+ * @time 10:23
+ */
+@Data
+public class PreResult {
+    protected String name = "";
+    protected String uniqueName = "";
+    protected String dateValue = "";
+    private String detailName = "";
+    private String maxValue = "";
+    private String minValue = "";
+    private String otherValue = "";
+    private String units = "";
+    private String value = "";
+    private String result = "";
+    //针对开单辅检项目
+    private String hisName = "";
+}

+ 41 - 0
src/main/java/com/diagbot/entity/Rule.java

@@ -0,0 +1,41 @@
+package com.diagbot.entity;
+
+import lombok.Data;
+
+/**
+ * @author kwz
+ * @date 2020/11/12
+ * @time 10:22
+ */
+@Data
+public class Rule {
+    private String id = "";
+    // 大类名称
+    private String pub_name = "";
+    // 最小值比较符
+    private String min_operator = "";
+    // 最小值
+    private String min_value = "";
+    // 最小值单位
+    private String min_unit = "";
+    // 最大值比较符
+    private String max_operator = "";
+    // 最大值
+    private String max_value = "";
+    // 最大值单位
+    private String max_unit = "";
+    // 标准值 用作等于
+    private String eq_operator = "";
+    // 标准值
+    private String eq_value = "";
+    // 标准值单位
+    private String eq_unit = "";
+    //提醒信息
+    private String remind = "";
+    //追加到文本尾部信息
+    private String suffixInfo = "";
+    //提醒信息
+    private String originText = "";
+    //his名称
+    private String hisName = "";
+}

+ 1 - 0
src/main/java/com/diagbot/enums/RedisEnum.java

@@ -17,6 +17,7 @@ public enum RedisEnum implements KeyedNamed {
     vitalType(5, "vitalType:"),
     symptomFeature(6, "symptomFeature:"),
     symptomMainFeature(7, "symptomMainFeature:"),
+    diseaseCorrespond(8, "diseaseCorrespond:"),
     diseaseType(2, "diseaseType:");
 
     @Setter

+ 10 - 0
src/main/java/com/diagbot/facade/CacheFacade.java

@@ -120,6 +120,16 @@ public class CacheFacade {
         neoFacade.symptomFeatureCache();
     }
 
+    /**
+     * 加载数据库中疾病对应缓存
+     *
+     * @return
+     */
+    public void getDiseaseCorrespondCache() {
+        redisUtil.deleteByPrex(RedisEnum.diseaseCorrespond.getName());
+        neoFacade.diseaseCorrespondCache();
+    }
+
     /**
      * 加载图谱中的疾病对应的症状个数
      *

+ 19 - 16
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -6,10 +6,7 @@ import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.client.ChiefPresentSimilarityServiceClient;
 import com.diagbot.client.StandConvertServiceClient;
 import com.diagbot.dto.*;
-import com.diagbot.entity.DiseaseInfo;
-import com.diagbot.entity.DiseaseProperty;
-import com.diagbot.entity.SymptomFeature;
-import com.diagbot.entity.SymptomNumOfDiS;
+import com.diagbot.entity.*;
 import com.diagbot.entity.node.LisRemind;
 import com.diagbot.entity.relationship.LisRemindGroup;
 import com.diagbot.entity.relationship.LisRemindMedicine;
@@ -18,6 +15,7 @@ import com.diagbot.enums.RedisEnum;
 import com.diagbot.enums.StandConvertEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
+import com.diagbot.mapper.GraphDiseaseCorrespondingMapper;
 import com.diagbot.mapper.SymptomFeatureMapper;
 import com.diagbot.model.entity.PD;
 import com.diagbot.repository.*;
@@ -111,6 +109,8 @@ public class NeoFacade {
     PacsResultRepository pacsResultRepository;
     @Autowired
     SymptomFeatureMapper symptomFeatureMapper;
+    @Autowired
+    GraphDiseaseCorrespondingMapper graphDiseaseCorrespondingMapper;
 
     /**
      * 返回药品缓存信息
@@ -209,6 +209,18 @@ public class NeoFacade {
         }
     }
 
+    public void diseaseCorrespondCache() {
+        List<GraphDiseaseCorresponding> symptomFeatures = graphDiseaseCorrespondingMapper.selectList(null);
+        if (ListUtil.isNotEmpty(symptomFeatures)) {
+            Map map = symptomFeatures.stream().collect(Collectors.toMap(
+                    k -> RedisEnum.diseaseCorrespond.getName() + k.getDiagPingan(),
+                    v -> v.getDiagIcd(),
+                    (v1, v2) -> (v2)
+            ));
+            redisTemplate.opsForValue().multiSet(map);
+        }
+    }
+
     public void symptomFeatureCache() {
         List<SymptomFeature> symptomFeatures = symptomFeatureMapper.selectList(null);
         if (ListUtil.isNotEmpty(symptomFeatures)) {
@@ -868,7 +880,7 @@ public class NeoFacade {
                 String tp = disIf.getTp();
                 List<String> col = disIf.getCol();
                 switch (tp) {
-                    case "医保疾病名称相关症状":
+                    case "医保疾病名称相关典型症状":
                         neoPushDTO.setSymptoms(col.stream().map(x -> NeoUtil.updatePushInfo(x)).collect(Collectors.toList()));
                         break;
                     case "医保疾病名称相关化验套餐名称":
@@ -1192,18 +1204,9 @@ public class NeoFacade {
      */
     public NeoPushDTO getDiagInfo(NeoPushVO neoPushVO) {
         NeoPushDTO pushDTO = new NeoPushDTO();
-        //        YiBaoDiseaseNode icdDiseaseNode = new YiBaoDiseaseNode();
         String term = neoPushVO.getDiagVo().getDiags().get(0).getName();
-        /*List<YiBaoDiseaseName> yiBaoName = yiBaoDiseaseRepository.findByNameIs(term);
-
-        YiBaoDiseaseName icdDisease = null;
-        if (ListUtil.isNotEmpty(yiBaoName)) {
-            icdDisease = yiBaoName.get(0);
-        }
-        if (icdDisease != null) {
-            icdDisease = NeoUtil.extract_node(icdDisease);
-            pushDTO = icdDiseaseNode.YiBaoDiseasetoDiseaseDTO(icdDisease, neoPushVO);
-        }*/
+        String o = (String)redisUtil.get(RedisEnum.diseaseCorrespond.getName() + term);
+        term = StringUtil.isNotBlank(o)?o:term;
         pushDTO = this.reverseInfo(term);
 
         return pushDTO;

+ 16 - 0
src/main/java/com/diagbot/facade/PushFacade.java

@@ -32,6 +32,21 @@ public class PushFacade {
     @Autowired
     FollowupPlanInfoFacade followupPlanInfoFacade;
 
+    /**
+     * 推送调icss5.0接口
+     * @param pushVo
+     * @return
+     */
+    public PushDTO pushFacIcss(PushVO pushVo) {
+        Map<String, Object> debug = new LinkedHashMap<>();
+        long pushStart = System.currentTimeMillis();
+        PushDTO pushDTO = pushProcess.processIcss(pushVo);
+        CoreUtil.getDebugStr(pushStart, "推送耗时", debug);
+        pushDTO.setDebug(debug);
+        return pushDTO;
+    }
+
+
     /**
      * 推送业务
      *
@@ -96,4 +111,5 @@ public class PushFacade {
 
         return pushPlanDTO;
     }
+
 }

+ 16 - 0
src/main/java/com/diagbot/mapper/GraphDiseaseCorrespondingMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.GraphDiseaseCorresponding;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-11-13
+ */
+public interface GraphDiseaseCorrespondingMapper extends BaseMapper<GraphDiseaseCorresponding> {
+
+}

+ 121 - 27
src/main/java/com/diagbot/process/PushProcess.java

@@ -1,17 +1,29 @@
 package com.diagbot.process;
 
 import com.diagbot.biz.push.entity.Item;
+import com.diagbot.biz.push.entity.Lis;
+import com.diagbot.biz.push.entity.Pacs;
+import com.diagbot.client.IcssPushServiceClient;
 import com.diagbot.dto.*;
+import com.diagbot.dto.icss.FeatureRate;
+import com.diagbot.dto.icss.Response;
+import com.diagbot.dto.icss.ResponseData;
+import com.diagbot.entity.PreResult;
 import com.diagbot.enums.DiseaseTypeEnum;
 import com.diagbot.enums.MedicalAdviceEnum;
 import com.diagbot.enums.StandConvertEnum;
 import com.diagbot.facade.CommonFacade;
 import com.diagbot.facade.NeoFacade;
 import com.diagbot.util.ListUtil;
+import com.diagbot.vo.IcssVo;
 import com.diagbot.vo.NeoPushVO;
 import com.diagbot.vo.PushVO;
 import com.diagbot.vo.neoPushEntity.Diag;
 import com.diagbot.vo.neoPushEntity.DiagVo;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -30,6 +42,111 @@ public class PushProcess {
     NeoFacade neoFacade;
     @Autowired
     CommonFacade commonFacade;
+    @Autowired
+    IcssPushServiceClient icssPushServiceClient;
+
+    public PushDTO processIcss(PushVO pushVo){
+        List<Item> diag1 = pushVo.getDiag();
+        int length = pushVo.getLength();
+        Map<String, List<String>> typeWords = Maps.newHashMap();
+        List<String> ruleTypeList = Arrays.asList(pushVo.getFeatureType().split(","));
+        List<String> pushDiags = Lists.newArrayList();
+        PushDTO pushDTO = new PushDTO();
+        IcssVo icssVo = pushVo2IcssVo(pushVo);
+        Response<ResponseData> annotation = icssPushServiceClient.getAnnotation(icssVo);
+        if(annotation != null){
+            ResponseData data = annotation.getData();
+            if(data != null){
+                List<FeatureRate> dis = data.getDis();
+                if(ListUtil.isNotEmpty(dis)){
+                    pushDiags = dis.stream().filter(x -> x.getDesc() == null || x.getDesc().contains("确诊") || x.getDesc().contains("拟诊"))
+                            .map(x -> x.getFeatureName()).collect(Collectors.toList());
+                }
+            }
+        }
+        Map<String, List<PushBaseDTO>> dis = new HashMap<>();
+        if (ListUtil.isNotEmpty(pushDiags)) {
+            //先把所有疾病推出来
+            if (ruleTypeList.contains("7")) {
+                List<PushBaseDTO> diseeases =  pushDiags.stream().map(x -> {
+                    PushBaseDTO pushBaseDTO = new PushBaseDTO();
+                    pushBaseDTO.setName(x);
+                    return pushBaseDTO;
+                }).collect(Collectors.toList());
+                diseeases = diseeases.subList(0, diseeases.size() >= length ? length : diseeases.size());
+                dis.put(DiseaseTypeEnum.possibleDis.getName(), diseeases);
+                pushDTO.setDis(dis);
+
+            }
+            //把第一个推送出来的诊断set到diagOrder中,再反推
+            NeoPushVO pushVO = new NeoPushVO();
+            DiagVo diagVo = new DiagVo();
+            diagVo.setDiags(pushDiags.stream().map(x ->{
+                Diag diag = new Diag();
+                diag.setName(x);
+                return diag;
+            }).collect(Collectors.toList()));
+            pushVO.setDiagVo(diagVo);
+            //调用反推
+            reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO, dis);
+
+        }
+
+        return pushDTO;
+    }
+
+    /**
+     * pushVo转Icss入参
+     * @param pushVo
+     * @return
+     */
+    public IcssVo pushVo2IcssVo(PushVO pushVo){
+        IcssVo icssVo = new IcssVo();
+        icssVo.setAge(Integer.parseInt(pushVo.getAge()));
+        String sexs = "";
+        Integer sex = pushVo.getSex();
+        if(sex == 1){
+            sexs = "M";
+        }else if(sex == 2){
+            sexs = "F";
+        }
+        icssVo.setSex(sexs);
+        icssVo.setChief(pushVo.getChief());
+        icssVo.setSymptom(pushVo.getSymptom());
+        icssVo.setVital(pushVo.getVital());
+        icssVo.setPasts(pushVo.getPasts());
+        icssVo.setPersonal(pushVo.getPersonal());
+        icssVo.setFeatureType(pushVo.getFeatureType());
+
+        List<Lis> lis = pushVo.getLis();
+        List<PreResult> lis_icss = lis.stream().map(x ->{
+            PreResult instantiate = BeanUtils.instantiate(PreResult.class);
+            BeanUtils.copyProperties(x,instantiate);
+            instantiate.setValue(x.getValue().toString());
+            instantiate.setMaxValue(x.getMaxValue().toString());
+            instantiate.setMinValue(x.getMinValue().toString());
+            return instantiate;
+        }).collect(Collectors.toList());
+        icssVo.setLis(lis_icss);
+
+        List<Pacs> pacs = pushVo.getPacs();
+        List<PreResult> pacs_icss = pacs.stream().map(x ->{
+            PreResult instantiate = new PreResult();
+            BeanUtils.copyProperties(x,instantiate);
+            return instantiate;
+        }).collect(Collectors.toList());
+        icssVo.setPacs(pacs_icss);
+        if(ListUtil.isNotEmpty(pushVo.getDiag())){
+            List<PreResult> diagOrder =  pushVo.getDiag().stream().map(x ->{
+                String name = x.getName();
+                PreResult preResult = new PreResult();
+                preResult.setValue(name);
+                return preResult;
+            }).collect(Collectors.toList());
+            icssVo.setDiagOrder(diagOrder);
+        }
+        return icssVo;
+    }
 
     public PushDTO process(PushVO pushVo, Map<String, Map<String, String>> standConvertMap, WordCrfDTO wordCrfDTO) {
         int length = pushVo.getLength();
@@ -58,32 +175,7 @@ public class PushProcess {
             reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO, dis);
         }
         return pushDTO;
-        /*//如果下的诊断有数据就反推
-        if (pushVO.getDiagVo() != null && ListUtil.isNotEmpty(pushVO.getDiagVo().getDiags())) {
-            reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO, dis);
-        } else {
-            //正推
-            List<String> push = neoFacade.getPush(pushVO);
-            if (ListUtil.isNotEmpty(push)) {
-                //先把所有疾病推出来
-                if (ruleTypeList.contains("7")) {
-//                    List<PushBaseDTO> diseeases = push.stream().filter(x -> x.getDisease() != null).map(x -> x.getDisease()).collect(Collectors.toList());
-                    List<PushBaseDTO> diseeases =  push.stream().map(x -> {
-                        PushBaseDTO pushBaseDTO = new PushBaseDTO();
-                        pushBaseDTO.setName(x);
-                        return pushBaseDTO;
-                    }).collect(Collectors.toList());
-                    diseeases = diseeases.subList(0, diseeases.size() >= length ? length : diseeases.size());
-                    dis.put(DiseaseTypeEnum.possibleDis.getName(), diseeases);
-                    pushDTO.setDis(dis);
-                }
-                //把第一个推送出来的诊断set到diagOrder中,再反推
-                setPushVo(pushVO, push);
-                //调用反推
-                reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO, dis);
-            }
-        }
-        return pushDTO;*/
+
     }
 
     private void setPushVo(NeoPushVO pushVO, List<String> push) {
@@ -207,8 +299,10 @@ public class PushProcess {
 
     private List<PushBaseDTO> getPackagePushBaseDTO(Map<String, List<String>> typeWords, List<String> symptoms, StandConvertEnum symptom) {
         List<PushBaseDTO> symptomPush = symptoms.stream()
-                .filter(x -> !typeWords.get(symptom.toString()).contains(x))
                 .map(x -> {
+                    x = ListUtil.isNotEmpty(typeWords.get(symptom.toString()))?!typeWords.get(symptom.toString()).contains(x)?x:"":x;
+                    return x;
+                }).filter(x -> StringUtils.isNotBlank(x)).map(x -> {
                     PushBaseDTO pushBaseDTO = new PushBaseDTO();
                     pushBaseDTO.setName(x);
                     return pushBaseDTO;

+ 16 - 0
src/main/java/com/diagbot/service/GraphDiseaseCorrespondingService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.GraphDiseaseCorresponding;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-11-13
+ */
+public interface GraphDiseaseCorrespondingService extends IService<GraphDiseaseCorresponding> {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/GraphDiseaseCorrespondingServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.GraphDiseaseCorresponding;
+import com.diagbot.mapper.GraphDiseaseCorrespondingMapper;
+import com.diagbot.service.GraphDiseaseCorrespondingService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-11-13
+ */
+@Service
+public class GraphDiseaseCorrespondingServiceImpl extends ServiceImpl<GraphDiseaseCorrespondingMapper, GraphDiseaseCorresponding> implements GraphDiseaseCorrespondingService {
+
+}

+ 159 - 0
src/main/java/com/diagbot/util/Constants.java

@@ -0,0 +1,159 @@
+/**   
+* @Company: 杭州朗通信息技术有限公司 
+* @Department: 系统软件部 
+* @Description: 朗通智能辅助诊疗系统 
+* @Address: 浙江省杭州市西湖区西斗门路3号 天堂软件园D-7B 
+*/
+package com.diagbot.util;
+
+/**
+* @Title: Constants.java 
+* @Package org.diagbot.public 
+* @Description: 通用常数接口定义  
+* @author 楼辉荣(Fyeman)   
+* @date 2015年4月23日 下午11:25:37 
+* @version V1.0
+ */
+public interface Constants {
+    /**
+     * 操作名称
+     */
+    String OP_NAME = "op";
+    /**
+     * 消息key
+     */
+    String MESSAGE = "message";
+    /**
+     * 错误key
+     */
+    String ERROR = "error";
+    /**
+     * 上个页面地址
+     */
+    String BACK_URL = "BackURL";
+    String IGNORE_BACK_URL = "ignoreBackURL";
+    /**
+     * 当前请求的地址 带参数
+     */
+    String CURRENT_URL = "currentURL";
+    /**
+     * 当前请求的地址 不带参数
+     */
+    String NO_QUERYSTRING_CURRENT_URL = "noQueryStringCurrentURL";
+    /**
+     * 上下文
+     */
+    String CONTEXT_PATH = "ctx";
+    /**
+     * 当前登录的用户
+     */
+    String CURRENT_APPLICATION = "c_app";
+    String CURRENT_USER = "c_user";
+    String CURRENT_USERNAME = "username";
+    String USER_MENUS = "menus";
+    
+    /**
+     * 管理控制台应用ID=0
+     */
+    long ADMIN_APPLICATION = 0;
+    /**
+     * 一级菜单grade标识
+     */
+    int FIRST_MENU = 1;
+    /**
+     * 二级菜单grade标识
+     */
+    int SECOND_MENU = 2;
+    /**
+     * 操作按钮等级标识
+     */
+    int MENU_GRADE = 3;
+    /**
+     * 最高级资源grade标识
+     */
+    int TOP_REC = 0;
+    /**
+     * 编码方式
+     */
+    String ENCODING = "UTF-8";
+    /**
+     * 系统用户状态--启用
+     */
+    int USER_STATUS_UNLOCK = 1;
+    /**
+     * 系统用户状态--禁用
+     */
+    int USER_STATUS_LOCK = 0;
+    /**
+     * 通用值0
+     */
+    int COMMON_INT_0 = 0;
+    /**
+     * 通用值1
+     */
+    int COMMON_INT_1 = 1;
+    /**
+     * 通用值-1
+     */
+    int COMMON_INT_NEG_1 = -1;
+    /**
+     * 通用值0
+     */
+    long COMMON_LONG_0 = 0L;
+    /**
+     * 通用值1
+     */
+    long COMMON_LONG_1 = 1L;
+    /**
+     * 通用值-1
+     */
+    long COMMON_LONG_NEG_1 = -1L;
+    /**
+     * 通用值"0"
+     */
+    String COMMON_STRING_0 = "0";
+    /**
+     * 通用值"1"
+     */
+    String COMMON_STRING_1 = "1";
+    /**
+     * 通用值"-1"
+     */
+    String COMMON_STRING_NEG_1 = "-1";
+    
+    /**
+     * 通用值"-1"
+     */
+    String COMMON_STRING_99 = "99";
+    /**
+     * 登录页面
+     */
+    String LOGIN_URL = "/login";
+    /**
+     * 上传文件夹
+     */
+    String UPLOAD_FOLDER_NAME = "upload";
+    /**
+     * 临时文件夹
+     */
+    String TEMP_FOLDER_NAME = "temp";
+    /**
+     * 地域标示
+     */
+    public static final String DEFAULT_LOCALE = "zh_CN";
+    /**
+     * 缺省字符集
+     */
+    public static final String DEFAULT_ENCODE = "UTF-8";
+    /**
+     * 以下为接口返回公共属性定义常量
+     */
+    public static final String MSG_SUCCESS = "操作成功";	//操作成功
+    public static final String MSG_FALURE = "操作失败";	//操作失败
+    
+    public static final long INVALIDATE_VALUE = -1;		//起止时间定义
+    public static final int RET_SUCCESS = 0; 			//成功
+	public static final int RET_FAIL = 1; 				//失败
+	public static final int RET_ERROR_PARAM = -1; 		//参数校验失败
+	public static final int RET_NO_TOKEN = -2; 	//用户token丢失
+}

+ 113 - 0
src/main/java/com/diagbot/vo/IcssVo.java

@@ -0,0 +1,113 @@
+package com.diagbot.vo;
+
+import com.diagbot.biz.push.entity.FeatureRate;
+import com.diagbot.entity.PreResult;
+import com.diagbot.entity.Rule;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Icss推送入参
+ * @author kwz
+ * @date 2020/11/12
+ * @time 10:20
+ */
+@Data
+public class IcssVo {
+    protected int length = 10;
+    protected int age_start = 0;
+    protected int age_end = 200;
+    protected int age = 0;
+    protected String sex;
+    //婚姻
+    protected String marriage;
+    // 搜索结果的贝叶斯阈值
+    protected String threshold = "0";
+    //特征类别
+    protected String featureType;
+    //诊断类别
+    protected Integer disType; //0:复诊,1:急诊
+    //特征类别对","进行分割后数据
+    protected String[] featureTypes;
+    //门诊 住院分类
+    protected String resourceType;
+    //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
+    protected String sysCode;
+
+    protected String normal  = "";
+    protected String chief  = "";
+    protected String symptom = "";
+    protected String vital = "";
+    protected String pasts = "";
+    protected String other = "";
+    //传染病史
+    protected String infectious = "";
+    //手术外伤史
+    protected String operation = "";
+    //过敏史
+    protected String allergy = "";
+    //接种史
+    protected String vaccination = "";
+    //个人史
+    protected String personal = "";
+    //婚育史
+    protected String marital = "";
+    //家族史
+    protected String family = "";
+    //月经史
+    protected String menstrual = "";
+    //化验文本输入
+    protected String lisString = "";
+    //pacs文本输入
+    protected String pacsString = "";
+    //疾病文本输入
+    protected String diagString = "";
+    //药品文本输入
+    protected String drugString = "";
+    //lis结构化数据
+    private List<PreResult> lis = new ArrayList<>();
+    //pacs结构化数据
+    private List<PreResult> pacs = new ArrayList<>();
+    //diag结构化数据
+    private List<PreResult> diag = new ArrayList<>();
+    //drug结构化数据
+    private List<PreResult> drug = new ArrayList<>();
+    //当前开单lis项目
+    protected List<PreResult> lisOrder = new ArrayList<>();
+    //当前开单pacs项目
+    protected List<PreResult> pacsOrder = new ArrayList<>();
+    //当前开单诊断项目
+    protected List<PreResult> diagOrder = new ArrayList<>();
+    //当前开单药品项目
+    protected List<PreResult> drugOrder = new ArrayList<>();
+    //当前开单手术项目
+    protected List<PreResult> operationOrder = new ArrayList<>();
+    //当前开单其他 预留
+    protected List<PreResult> otherOrder = new ArrayList<>();
+    //大数据推送诊断结果信息
+    protected List<FeatureRate> pushDiags = new ArrayList<>();
+    //选中诊断
+    private PreResult diseaseName = new PreResult();;
+    //量表
+    protected String scaleName = "";
+    //指标结果
+    protected String indications="";
+    //模型
+    protected String algorithmClassifyValue;
+    //推送条件
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.8f);
+    //知识图谱推送条件
+    private Map<String, Map<String, String>> graphInputs = new HashMap<>(10, 0.8f);
+    //阴性 页面录入数据需要对结果过滤的集合
+    private Map<String, Map<String, String>> filters = new HashMap<>(10, 0.8f);
+    //满足规则的ID集合
+    private Map<String, List<Rule>> rules = new HashMap<>();
+    //特征推送走的模型 1:机器学习 2:朴素贝叶斯
+    private Integer algorithmType;
+    //规则类型 1:危机值提醒,2:开单合理性,3:管理评估,4:不良反应,5:药物推荐,6:异常值
+    private String ruleType;
+}

+ 1 - 0
src/main/java/com/diagbot/web/CacheController.java

@@ -40,6 +40,7 @@ public class CacheController {
         cacheFacade.getVitalCache();
         cacheFacade.getSymptomNumCache();
         cacheFacade.getSymptomFeatureCache();
+        cacheFacade.getDiseaseCorrespondCache();
         return RespDTO.onSuc(true);
     }
 

+ 3 - 2
src/main/java/com/diagbot/web/CoreController.java

@@ -45,8 +45,9 @@ public class CoreController {
     @ApiOperation(value = "推送API[zhoutg]", notes = "featureType 类型(多选必填),1:症状,4:查体结果,5:检验,6:检查,7:诊断,8:药品,9:手术,10:一般治疗")
     @PostMapping("/push")
     public RespDTO<PushDTO> push(@RequestBody PushVO pushVo) {
-        PushDTO pushDTO = pushFacade.pushFac(pushVo);
-        return RespDTO.onSuc(pushDTO);
+//        PushDTO pushDTO = pushFacade.pushFac(pushVo);
+        PushDTO pushDTO1 = pushFacade.pushFacIcss(pushVo);
+        return RespDTO.onSuc(pushDTO1);
     }
 
     @ApiOperation(value = "推送持续检验检查计划API[zhaops]", notes = "operationName:随访手术")

+ 3 - 0
src/main/resources/application-local.yml

@@ -156,4 +156,7 @@ StandConvert:
   url: http://192.168.2.234:23232
   rate: 0.9
 
+IcssPush:
+  url: http://192.168.2.234:5008
+
 debugFlag: true

+ 3 - 0
src/main/resources/application-pre.yml

@@ -156,4 +156,7 @@ StandConvert:
   url: http://192.168.2.234:23232
   rate: 0.9
 
+IcssPush:
+  url: http://192.168.2.186:5008
+
 debugFlag: true

+ 3 - 0
src/main/resources/application-pro.yml

@@ -158,4 +158,7 @@ StandConvert:
   url: http://192.168.2.234:23232
   rate: 0.9
 
+IcssPush:
+  url: http://192.168.2.123:5008
+
 debugFlag: true

+ 3 - 0
src/main/resources/application-test.yml

@@ -156,4 +156,7 @@ StandConvert:
   url: http://192.168.2.234:23232
   rate: 0.9
 
+IcssPush:
+  url: http://192.168.2.241:5008
+
 debugFlag: true

+ 12 - 0
src/main/resources/mapper/GraphDiseaseCorrespondingMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.GraphDiseaseCorrespondingMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.GraphDiseaseCorresponding">
+        <id column="id" property="id" />
+        <result column="diag_pingan" property="diagPingan" />
+        <result column="diag_icd" property="diagIcd" />
+    </resultMap>
+
+</mapper>