|
@@ -1,10 +1,13 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.biz.push.entity.FeatureRateV2;
|
|
|
+import com.diagbot.biz.push.entity.FeatureRateWithExplainV2;
|
|
|
import com.diagbot.biz.push.entity.ResponseDataWithExplainV2;
|
|
|
import com.diagbot.client.AiptServiceClient;
|
|
|
import com.diagbot.client.TranServiceClient;
|
|
|
+import com.diagbot.dto.AIDTO;
|
|
|
import com.diagbot.dto.DiseaseDeptDTO;
|
|
|
+import com.diagbot.dto.FeatureRateDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.dto.SYFDTO;
|
|
|
import com.diagbot.dto.SYFDeptDTO;
|
|
@@ -44,11 +47,41 @@ public class AIV2Facade {
|
|
|
private AssembleFacade assembleFacade;
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 症状推理
|
|
|
+ *
|
|
|
+ * @param aivo
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AIDTO pushV2(AIVO aivo, String type) {
|
|
|
+ RespDTO<ResponseDataWithExplainV2> res
|
|
|
+ = aiptServiceClient.pushWithExplainV2(assembleFacade.assembleData(aivo, type));
|
|
|
+ RespDTOUtil.respNGDealCover(res, "中间层没有结果返回");
|
|
|
+ AIDTO aidto = new AIDTO();
|
|
|
+
|
|
|
+ List<FeatureRateWithExplainV2> symptom = res.data.getSymptom();
|
|
|
+ if (ListUtil.isNotEmpty(symptom)) {
|
|
|
+ List<FeatureRateDTO> symptomDTO = BeanUtil.listCopyTo(symptom, FeatureRateDTO.class);
|
|
|
+ aidto.setItems(symptomDTO);
|
|
|
+ }
|
|
|
+ return aidto;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 邵逸夫诊断推理
|
|
|
+ *
|
|
|
+ * @param aivo
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public SYFDTO pushDisForSYFV2(AIVO aivo, String type) {
|
|
|
if (StringUtil.isBlank(aivo.getHospitalCode())) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院编码");
|
|
|
}
|
|
|
- RespDTO<ResponseDataWithExplainV2> res = aiptServiceClient.pushWithExplainV2(assembleFacade.assembleData(aivo, type));
|
|
|
+ RespDTO<ResponseDataWithExplainV2> res
|
|
|
+ = aiptServiceClient.pushWithExplainV2(assembleFacade.assembleData(aivo, type));
|
|
|
RespDTOUtil.respNGDealCover(res, "中间层没有结果返回");
|
|
|
SYFDTO syfdto = new SYFDTO();
|
|
|
|
|
@@ -115,14 +148,14 @@ public class AIV2Facade {
|
|
|
featureRateList.addAll(disFeatureMap.get("可能诊断"));
|
|
|
}
|
|
|
|
|
|
- if(ListUtil.isEmpty(featureRateList)){
|
|
|
+ if (ListUtil.isEmpty(featureRateList)) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "推理结果为空");
|
|
|
}
|
|
|
|
|
|
//过滤科室为空的数据
|
|
|
- featureRateList=featureRateList
|
|
|
+ featureRateList = featureRateList
|
|
|
.stream()
|
|
|
- .filter(i->StringUtil.isNotBlank(i.getConcatDept()))
|
|
|
+ .filter(i -> StringUtil.isNotBlank(i.getConcatDept()))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
List<SYFFeatureDTO> syfFeatureDTOList = featureRateList
|