|
@@ -2,6 +2,7 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.diagbot.client.AiptServiceClient;
|
|
|
import com.diagbot.client.BigDataServiceClient;
|
|
|
import com.diagbot.client.GraphServiceClient;
|
|
|
import com.diagbot.client.TranServiceClient;
|
|
@@ -29,15 +30,9 @@ import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.FastJsonUtils;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
-import com.diagbot.vo.EMRPushVO;
|
|
|
-import com.diagbot.vo.HosCodeVO;
|
|
|
-import com.diagbot.vo.LisKYJVO;
|
|
|
-import com.diagbot.vo.LisResult;
|
|
|
-import com.diagbot.vo.LisResultVO;
|
|
|
-import com.diagbot.vo.PushKYJVO;
|
|
|
-import com.diagbot.vo.PushVO;
|
|
|
-import com.diagbot.vo.QuestionVO;
|
|
|
+import com.diagbot.vo.*;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import io.micrometer.core.instrument.search.Search;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -73,14 +68,16 @@ public class PushFacade {
|
|
|
private LisMappingFacade lisMappingFacade;
|
|
|
@Autowired
|
|
|
private TranServiceClient tranServiceClient;
|
|
|
+ @Autowired
|
|
|
+ private AiptServiceClient aiptServiceClient;
|
|
|
|
|
|
/**
|
|
|
- * 推理接口
|
|
|
+ * 拼装数据
|
|
|
*
|
|
|
* @param pushVO
|
|
|
- * @return
|
|
|
+ * @return SearchData
|
|
|
*/
|
|
|
- public ResponseData pushAI(PushVO pushVO) {
|
|
|
+ public SearchData assembleData(PushVO pushVO) {
|
|
|
SearchData searchData = new SearchData();
|
|
|
searchData.setAge(pushVO.getAge());
|
|
|
searchData.setSymptom(pushVO.getSymptom());
|
|
@@ -129,6 +126,17 @@ public class PushFacade {
|
|
|
List<LisResult> lisResultList = BeanUtil.listCopyTo(pushVO.getLis(), LisResult.class);
|
|
|
searchData.setLisArr(lisResultList);
|
|
|
|
|
|
+ return searchData;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 大数据接口
|
|
|
+ *
|
|
|
+ * @param searchData
|
|
|
+ * @return ResponseData
|
|
|
+ */
|
|
|
+ public ResponseData pushAI(SearchData searchData) {
|
|
|
Response<ResponseData> res = bigDataServiceClient.bayesPageData(searchData);
|
|
|
if (null == res || null == res.getData()) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "AI没有返回结果");
|
|
@@ -136,6 +144,20 @@ public class PushFacade {
|
|
|
return res.getData();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 中间层接口
|
|
|
+ *
|
|
|
+ * @param searchData
|
|
|
+ * @return ResponseData
|
|
|
+ */
|
|
|
+ public ResponseData pushAipt(SearchData searchData) {
|
|
|
+ Response<ResponseData> res = aiptServiceClient.aiptData(searchData);
|
|
|
+ if (null == res || null == res.getData()) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "中间层没有返回结果");
|
|
|
+ }
|
|
|
+ return res.getData();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 推理接口
|
|
|
*
|
|
@@ -144,7 +166,9 @@ public class PushFacade {
|
|
|
*/
|
|
|
public PushDTO pushInner(PushVO pushVO, Integer mode) {
|
|
|
PushDTO pushDTO = new PushDTO();
|
|
|
- ResponseData data = pushAI(pushVO);
|
|
|
+ SearchData Data = assembleData(pushVO);
|
|
|
+// ResponseData data = pushAI(searchData);
|
|
|
+ ResponseData data = pushAipt(Data);
|
|
|
|
|
|
String featureType = pushVO.getFeatureType();
|
|
|
String[] featureTypes = featureType.split(",|,");
|
|
@@ -323,7 +347,8 @@ public class PushFacade {
|
|
|
}
|
|
|
pushVO.setLis(lisResultVOList);
|
|
|
|
|
|
- ResponseData responseData = pushAI(pushVO);
|
|
|
+ SearchData searchData = assembleData(pushVO);
|
|
|
+ ResponseData responseData = pushAI(searchData);
|
|
|
PushKYJDTO pushKYJDTO = new PushKYJDTO();
|
|
|
pushKYJDTO.setLabs(responseData.getLabs());
|
|
|
pushKYJDTO.setDis(responseData.getDis());
|
|
@@ -494,7 +519,9 @@ public class PushFacade {
|
|
|
}
|
|
|
pushVO.setLis(lisResultVOList);
|
|
|
}
|
|
|
- ResponseData data = pushAI(pushVO);
|
|
|
+
|
|
|
+ SearchData searchData = assembleData(pushVO);
|
|
|
+ ResponseData data = pushAI(searchData);
|
|
|
String featureType = pushVO.getFeatureType();
|
|
|
String[] featureTypes = featureType.split(",|,");
|
|
|
Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
|
|
@@ -573,7 +600,7 @@ public class PushFacade {
|
|
|
}
|
|
|
}
|
|
|
//警惕
|
|
|
- SearchData searchData = new SearchData();
|
|
|
+ searchData = new SearchData();
|
|
|
searchData.setDiag(String.join(",", disNameList));
|
|
|
Response<GdbResponse> graphRes = graphServiceClient.highRiskPageData(searchData);
|
|
|
Map<String, String> graphResult = graphRes.getData().getResult();
|