浏览代码

中间层预处理化验结果

MarkHuang 6 年之前
父节点
当前提交
aadf40207c

+ 20 - 0
aipt-service/src/main/java/com/diagbot/client/AIServiceClient.java

@@ -0,0 +1,20 @@
+package com.diagbot.client;
+
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.vo.SearchVo;
+import com.diagbot.client.hystrix.AIServiceHystrix;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 13:15
+ */
+@FeignClient(name = "AI", url = "${ai.server.address}", fallback = AIServiceHystrix.class)
+public interface AIServiceClient {
+    @PostMapping(value = "/push-web/algorithm/neural")
+    Response<ResponseData> bayesPageData(@RequestBody SearchVo searchVo);
+}

+ 53 - 0
aipt-service/src/main/java/com/diagbot/client/AlgorithmClassify.java

@@ -0,0 +1,53 @@
+package com.diagbot.client;
+
+/**
+ * @Auther: fyeman
+ * @Date: 2018/7/19/019 10:37
+ * @Description:
+ */
+public enum AlgorithmClassify {
+    NEURAL("0"), BAYES("1"), EMERGENCY_NEURAL("2"), OUTPATIENT_NEURAL("3"),
+    NEURAL_SYMPTOM("11"),
+    NEURAL_DIAG("21"),
+    NEURAL_VITAL("31"),
+    NEURAL_LIS("41"),
+    NEURAL_PACS("51"),
+    NEURAL_DIAG_SYMPTOM("111"),
+    NEURAL_DIAG_VITAL("131"),
+    NEURAL_DIAG_LIS("141"),
+    NEURAL_DIAG_PACS("151");
+
+    private String value;
+
+    AlgorithmClassify(String value) {
+        this.value = value;
+    }
+
+    public String toString() {
+        return value;
+    }
+
+    public static AlgorithmClassify parse(String value) {
+        switch (value) {
+            case "11":
+                return AlgorithmClassify.NEURAL_SYMPTOM;
+            case "21":
+                return AlgorithmClassify.NEURAL_DIAG;
+            case "31":
+                return AlgorithmClassify.NEURAL_VITAL;
+            case "41":
+                return AlgorithmClassify.NEURAL_LIS;
+            case "51":
+                return AlgorithmClassify.NEURAL_PACS;
+            case "111":
+                return AlgorithmClassify.NEURAL_DIAG_SYMPTOM;
+            case "131":
+                return AlgorithmClassify.NEURAL_DIAG_VITAL;
+            case "141":
+                return AlgorithmClassify.NEURAL_DIAG_LIS;
+            case "151":
+                return AlgorithmClassify.NEURAL_DIAG_PACS;
+        }
+        return AlgorithmClassify.NEURAL_DIAG;
+    }
+}

+ 202 - 0
aipt-service/src/main/java/com/diagbot/client/Feature.java

@@ -0,0 +1,202 @@
+package com.diagbot.client;
+
+import java.io.Serializable;
+
+/**
+ * @Title: Feature.java
+ * @Package: com.zjlantone.nlp.web.doc.dao.model
+ * @Description: 数据库操作接口类
+ * @author: 楼辉荣
+ * @date: 2016年8月8日 下午17:16:23
+ * @version: V1.0
+ */
+
+@SuppressWarnings("serial")
+public class Feature implements Serializable {
+    /****/
+    private Long id;
+    /****/
+    private String rdn = "";
+    /****/
+    private String sex;
+    /****/
+    private int age;
+
+    private String partbody = "";
+
+    /****/
+    private String featureName = "";
+
+    /****/
+    private String featureType = "";
+
+    //是否推送
+    private String isPush = "0";
+
+    /**
+     * 特征顺序号
+     **/
+    private int sn;
+
+    /****/
+    private String negative = "";
+
+    private float duration;
+
+    private String property;
+
+    /****/
+    private Float threshold;
+
+    /****/
+    private String tfIdf;
+
+    /**
+     * 区分住院门诊
+     **/
+    private String resourceType;
+
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return this.id;
+    }
+
+    public void setRdn(String rdn) {
+        this.rdn = rdn;
+    }
+
+    public String getRdn() {
+        return this.rdn;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getSex() {
+        return this.sex;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public int getAge() {
+        return this.age;
+    }
+
+    public void setFeatureName(String featureName) {
+        this.featureName = featureName;
+    }
+
+    public String getFeatureName() {
+        return this.featureName;
+    }
+
+    public void setFeatureType(String featureType) {
+        this.featureType = featureType;
+    }
+
+    public String getFeatureType() {
+        return this.featureType;
+    }
+
+    public String getIsPush() {
+        return isPush;
+    }
+
+    public void setIsPush(String isPush) {
+        this.isPush = isPush;
+    }
+
+    public int getSn() {
+        return sn;
+    }
+
+    public void setSn(int sn) {
+        this.sn = sn;
+    }
+
+    public void setNegative(String negative) {
+        this.negative = negative;
+    }
+
+    public String getNegative() {
+        return this.negative;
+    }
+
+    public String getPartbody() {
+        return partbody;
+    }
+
+    public void setPartbody(String partbody) {
+        this.partbody = partbody;
+    }
+
+    public float getDuration() {
+        return duration;
+    }
+
+    public void setDuration(float duration) {
+        this.duration = duration;
+    }
+
+    public String getProperty() {
+        return property;
+    }
+
+    public void setProperty(String property) {
+        this.property = property;
+    }
+
+    public void setThreshold(Float threshold) {
+        this.threshold = threshold;
+    }
+
+    public Float getThreshold() {
+        return this.threshold;
+    }
+
+    public void setTfIdf(String tfIdf) {
+        this.tfIdf = tfIdf;
+    }
+
+    public String getTfIdf() {
+        return this.tfIdf;
+    }
+
+    public String getResourceType() {
+        return resourceType;
+    }
+
+    public void setResourceType(String resourceType) {
+        this.resourceType = resourceType;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        Feature feature = (Feature) o;
+        if (id != feature.id) {
+            return false;
+        }
+        return rdn.equals(feature.rdn) && partbody.equals(feature.partbody) && featureName.equals(feature.featureName)
+                && featureType.equals(feature.featureType) && negative.equals(feature.negative);
+    }
+
+    @Override
+    public int hashCode() {
+        int result = id.hashCode();
+        result = 31 * result + rdn.hashCode() + partbody.hashCode() + featureName.hashCode() + featureType.hashCode() + negative.hashCode();
+        return result;
+    }
+}

+ 159 - 0
aipt-service/src/main/java/com/diagbot/client/bean/Constants.java

@@ -0,0 +1,159 @@
+/**
+ * @Company: 杭州朗通信息技术有限公司
+ * @Department: 系统软件部
+ * @Description: 朗通智能辅助诊疗系统
+ * @Address: 浙江省杭州市西湖区西斗门路3号 天堂软件园D-7B
+ */
+package com.diagbot.client.bean;
+
+/**
+ * @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丢失
+}

+ 43 - 0
aipt-service/src/main/java/com/diagbot/client/bean/FeatureRate.java

@@ -0,0 +1,43 @@
+package com.diagbot.client.bean;
+
+/**
+ * Created by fyeman on 2018/1/17.
+ */
+public class FeatureRate {
+    private String featureName;
+    private String extraProperty;
+    private String desc;
+    private String rate;
+
+    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 getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    public String getExtraProperty() {
+        return extraProperty;
+    }
+
+    public void setExtraProperty(String extraProperty) {
+        this.extraProperty = extraProperty;
+    }
+}

+ 190 - 0
aipt-service/src/main/java/com/diagbot/client/bean/Response.java

@@ -0,0 +1,190 @@
+package com.diagbot.client.bean;
+
+/**
+ * ClassName: org.diagbot.pub.api.Response
+ * Function: API接口提供标准返回数据包, 数据包格式如下:
+ * {
+ * status:"OK",
+ * startTime:8206448610408,
+ * endTime:8206448610418,
+ * version:"1.0",
+ * msg:"操作成功",
+ * ret:"0",
+ * timeConsum:10,
+ * data:{
+ * ..。
+ * }
+ * }
+ * date: 2015年7月6日 下午1:36:58
+ *
+ * @author 楼辉荣(Fyeman)
+ * @version 1.0
+ * @since JDK 1.7
+ */
+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;
+    }
+
+}

+ 98 - 0
aipt-service/src/main/java/com/diagbot/client/bean/ResponseData.java

@@ -0,0 +1,98 @@
+package com.diagbot.client.bean;
+
+import com.alibaba.fastjson.JSONObject;
+
+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 Map<String, JSONObject> treat;
+
+    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 List<FeatureRate> getHistory() {
+        return history;
+    }
+
+    public void setHistory(List<FeatureRate> history) {
+        this.history = history;
+    }
+
+    public Map<String, JSONObject> getTreat() {
+        return treat;
+    }
+
+    public void setTreat(Map<String, JSONObject> treat) {
+        this.treat = treat;
+    }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+}

+ 273 - 0
aipt-service/src/main/java/com/diagbot/client/bean/SearchData.java

@@ -0,0 +1,273 @@
+package com.diagbot.client.bean;
+
+import com.diagbot.client.AlgorithmClassify;
+import com.diagbot.client.Feature;
+import com.diagbot.dto.LisResult;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by fyeman on 2018/1/31.
+ */
+public class SearchData {
+    private int length = 10;
+    private int age_start = 0;
+    private int age_end = 200;
+    private int age = 0;
+    private String sex;
+    // 搜索结果的贝叶斯阈值
+    private String threshold = "0";
+
+    private String symptom = "";
+    private String vital = "";
+    private String lis = "";
+    private String pacs = "";
+    private String diag = "";
+    private String past = "";
+    private String other = "";
+    private List<LisResult> lisArr;
+
+
+    //特征类别
+    private String featureType;
+    //特征类别对","进行分割后数据
+    private String[] featureTypes;
+    //门诊 住院分类
+    private String resourceType;
+    //模型
+    private AlgorithmClassify algorithmClassify[];
+    //模型
+    private String algorithmClassifyValue;
+    //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
+    private String sysCode;
+
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.8f);
+
+
+    private List<Feature> symptomFeatureList = new ArrayList<>();
+    private List<Feature> vitalFeatureList = new ArrayList<>();
+    private List<Feature> lisFeatureList = new ArrayList<>();
+    private List<Feature> pacsFeatureList = new ArrayList<>();
+    private List<Feature> diagFeatureList = new ArrayList<>();
+    private List<Feature> symptompropertyFeatureList = new ArrayList<>();
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        this.length = length;
+    }
+
+    public int getAge_start() {
+        return age_start;
+    }
+
+    public void setAge_start(int age_start) {
+        this.age_start = age_start;
+    }
+
+    public int getAge_end() {
+        return age_end;
+    }
+
+    public void setAge_end(int age_end) {
+        this.age_end = age_end;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(String symptom) {
+        this.symptom = symptom;
+    }
+
+    public String getVital() {
+        return vital;
+    }
+
+    public void setVital(String vital) {
+        this.vital = vital;
+    }
+
+    public String getLis() {
+        return lis;
+    }
+
+    public void setLis(String lis) {
+        this.lis = lis;
+    }
+
+    public String getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(String pacs) {
+        this.pacs = pacs;
+    }
+
+    public String getDiag() {
+        return diag;
+    }
+
+    public void setDiag(String diag) {
+        this.diag = diag;
+    }
+
+    public String getPast() {
+        return past;
+    }
+
+    public void setPast(String past) {
+        this.past = past;
+    }
+
+    public String getOther() {
+        return other;
+    }
+
+    public void setOther(String other) {
+        this.other = other;
+    }
+
+    public String getFeatureType() {
+        return featureType;
+    }
+
+    public void setFeatureType(String featureType) {
+        this.featureType = featureType;
+    }
+
+    public String[] getFeatureTypes() {
+        return featureTypes;
+    }
+
+    public void setFeatureTypes(String[] featureTypes) {
+        this.featureTypes = featureTypes;
+    }
+
+    public String getResourceType() {
+        return resourceType;
+    }
+
+    public void setResourceType(String resourceType) {
+        this.resourceType = resourceType;
+    }
+
+    public String getSysCode() {
+        return sysCode;
+    }
+
+    public void setSysCode(String sysCode) {
+        this.sysCode = sysCode;
+    }
+
+    public void setThreshold(String threshold) {
+        this.threshold = threshold;
+    }
+
+    public float getThreshold() {
+        return Float.parseFloat(threshold);
+    }
+
+    public List<Feature> getSymptomFeatureList() {
+        return symptomFeatureList;
+    }
+
+    public void setSymptomFeatureList(List<Feature> symptomFeatureList) {
+        this.symptomFeatureList = symptomFeatureList;
+    }
+
+    public List<Feature> getVitalFeatureList() {
+        return vitalFeatureList;
+    }
+
+    public void setVitalFeatureList(List<Feature> vitalFeatureList) {
+        this.vitalFeatureList = vitalFeatureList;
+    }
+
+    public List<Feature> getLisFeatureList() {
+        return lisFeatureList;
+    }
+
+    public void setLisFeatureList(List<Feature> lisFeatureList) {
+        this.lisFeatureList = lisFeatureList;
+    }
+
+    public List<Feature> getPacsFeatureList() {
+        return pacsFeatureList;
+    }
+
+    public void setPacsFeatureList(List<Feature> pacsFeatureList) {
+        this.pacsFeatureList = pacsFeatureList;
+    }
+
+
+    public List<Feature> getSymptompropertyFeatureList() {
+        return symptompropertyFeatureList;
+    }
+
+    public void setSymptompropertyFeatureList(List<Feature> symptompropertyFeatureList) {
+        this.symptompropertyFeatureList = symptompropertyFeatureList;
+    }
+
+    public List<Feature> getDiagFeatureList() {
+        return diagFeatureList;
+    }
+
+    public void setDiagFeatureList(List<Feature> diagFeatureList) {
+        this.diagFeatureList = diagFeatureList;
+    }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+
+    public AlgorithmClassify[] getAlgorithmClassify() {
+        return algorithmClassify;
+    }
+
+    public void setAlgorithmClassify(AlgorithmClassify[] algorithmClassify) {
+        this.algorithmClassify = algorithmClassify;
+    }
+
+    public String getAlgorithmClassifyValue() {
+        return algorithmClassifyValue;
+    }
+
+    public void setAlgorithmClassifyValue(String algorithmClassifyValue) {
+        this.algorithmClassifyValue = algorithmClassifyValue;
+    }
+
+    public List<LisResult> getLisArr() {
+        return lisArr;
+    }
+
+    public void setLisArr(List<LisResult> lisArr) {
+        this.lisArr = lisArr;
+    }
+}

+ 132 - 0
aipt-service/src/main/java/com/diagbot/client/bean/Status.java

@@ -0,0 +1,132 @@
+package com.diagbot.client.bean;
+
+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;
+    }
+
+}

+ 23 - 0
aipt-service/src/main/java/com/diagbot/client/hystrix/AIServiceHystrix.java

@@ -0,0 +1,23 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.AIServiceClient;
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.vo.SearchVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 13:15
+ */
+@Component
+@Slf4j
+public class AIServiceHystrix implements AIServiceClient {
+    @Override
+    public Response<ResponseData> bayesPageData(SearchVo searchVo) {
+        log.error("【hystrix】调用{}异常", "bayesPageData");
+        return null;
+    }
+}

+ 22 - 0
aipt-service/src/main/java/com/diagbot/dto/LisResult.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @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;//其他结果,包括阴性阳性,文字描述等
+}

+ 53 - 0
aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java

@@ -0,0 +1,53 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.LisResult;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+import com.diagbot.vo.SearchVo;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  数据处理业务层
+ * </p>
+ *
+ * @author Mark Huang
+ * @since 2019-03-04
+ */
+@Component
+public class ClinicalFacade {
+    /**
+     * 处理临床数据
+     *
+     * @param searchVo
+     * @return SearchVo
+     */
+    public SearchVo processClinicalData(@RequestBody SearchVo searchVo) {
+        SearchVo sData = searchVo;
+
+        sData.setLisArr(processLis(sData.getLisArr()));
+
+        return sData;
+    }
+
+    private List<LisResult> processLis(List<LisResult> lisArr) {
+
+        String Otherval = "";
+
+        for (int i=0; i<lisArr.size(); i++) {
+            LisResult lisres = lisArr.get(i);
+
+            Otherval = (lisres.getOtherValue().trim().length() > 0)? lisres.getOtherValue().trim()+"\n":"";
+
+            if (lisres.getMaxValue() != null && lisres.getValue() > lisres.getMaxValue()) {
+                lisres.setOtherValue(Otherval + "超出标准");
+            }
+            else if (lisres.getMinValue() != null && lisres.getValue() < lisres.getMinValue()) {
+                lisres.setOtherValue(Otherval + "低于标准");
+            }
+        }
+
+        return lisArr;
+    }
+}

+ 64 - 0
aipt-service/src/main/java/com/diagbot/vo/SearchVo.java

@@ -0,0 +1,64 @@
+package com.diagbot.vo;
+
+import com.diagbot.dto.LisResult;
+import lombok.Getter;
+import lombok.Setter;
+
+import com.diagbot.client.Feature;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: Weixuan Huang
+ * @time: 2019/3/4 16:35
+ */
+@Getter
+@Setter
+public class SearchVo {
+    private String sex;
+    private int age;
+    private int age_start;
+    private int age_end;
+
+    private String symptom;
+    private String vital;
+    private String lis;
+    private String pacs;
+    private String other;
+    private String featureType;
+    private String diag;
+
+    private int length;
+
+
+    // 搜索结果的贝叶斯阈值
+    private String threshold;
+
+    private List<Feature> symptomFeatureList;
+    private List<Feature> lisFeatureList;
+    private List<Feature> pacsFeatureList;
+    private List<Feature> vitalFeatureList;
+    private List<Feature> symptompropertyFeatureList;
+
+    private List<LisResult> lisArr;
+    private List<Feature> diagFeatureList;
+    private Map<String, Map<String, String>> inputs;
+
+
+    /*
+    private String past;
+    //特征类别对","进行分割后数据
+    private String[] featureTypes;
+    //门诊 住院分类
+    private String resourceType;
+    //模型
+    private AlgorithmClassify algorithmClassify[];
+    //模型
+    private String algorithmClassifyValue;
+    //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
+    private String sysCode;
+    */
+
+}

+ 56 - 0
aipt-service/src/main/java/com/diagbot/web/ClinicalController.java

@@ -0,0 +1,56 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.client.AIServiceClient;
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.ClinicalFacade;
+import com.diagbot.vo.SearchVo;
+import io.swagger.annotations.Api;
+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;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Mark Huang
+ * @since 2019-03-04
+ */
+@RestController
+@RequestMapping("/clinicaldata")
+@Api(value = "临床数据处理API", tags = { "临床数据处理API" })
+
+public class ClinicalController {
+    @Autowired
+    private ClinicalFacade clinicalFacade;
+
+    @Autowired
+    private AIServiceClient aiServiceClient;
+
+    @ApiOperation(value = "临床数据处理", notes = "")
+    @PostMapping("/processData")
+    @SysLogger("processData")
+    public RespDTO<ResponseData> processData(@Valid @RequestBody SearchVo searchVo) {
+
+        SearchVo sData = clinicalFacade.processClinicalData(searchVo);
+
+//        Response<ResponseData> res = aiServiceClient.bayesPageData(sData);
+
+        Response<SearchVo> res = new Response<>();
+        res.setData(sData);
+
+        return RespDTO.onSuc(res.getData());
+    }
+
+}

+ 3 - 0
config-server/src/main/resources/shared/aipt-service-dev.yml

@@ -92,3 +92,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
+ai:
+  server:
+    address: http://192.168.2.234:5008

+ 3 - 0
config-server/src/main/resources/shared/aipt-service-local.yml

@@ -92,3 +92,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
+ai:
+  server:
+    address: http://192.168.2.234:5008

+ 3 - 0
config-server/src/main/resources/shared/aipt-service-pro.yml

@@ -92,3 +92,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
+ai:
+  server:
+    address: http://192.168.2.234:5008

+ 3 - 0
config-server/src/main/resources/shared/aipt-service-test.yml

@@ -92,3 +92,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
+ai:
+  server:
+    address: http://192.168.2.234:5008