|
@@ -8,6 +8,7 @@ import com.diagbot.client.AiptServiceClient;
|
|
import com.diagbot.client.TranServiceClient;
|
|
import com.diagbot.client.TranServiceClient;
|
|
import com.diagbot.dto.AIDTO;
|
|
import com.diagbot.dto.AIDTO;
|
|
import com.diagbot.dto.DiseaseDeptDTO;
|
|
import com.diagbot.dto.DiseaseDeptDTO;
|
|
|
|
+import com.diagbot.dto.FeatureConceptDTO;
|
|
import com.diagbot.dto.FeatureRateDTO;
|
|
import com.diagbot.dto.FeatureRateDTO;
|
|
import com.diagbot.dto.HospitalDeptDTO;
|
|
import com.diagbot.dto.HospitalDeptDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
@@ -53,6 +54,8 @@ public class AIFacade {
|
|
private AiptServiceClient aiptServiceClient;
|
|
private AiptServiceClient aiptServiceClient;
|
|
@Autowired
|
|
@Autowired
|
|
private TranServiceClient tranServiceClient;
|
|
private TranServiceClient tranServiceClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ private FeatureFacade featureFacade;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 调用ai接口业务逻辑
|
|
* 调用ai接口业务逻辑
|
|
@@ -186,6 +189,10 @@ public class AIFacade {
|
|
if (StringUtil.isBlank(aivo.getHospitalCode())) {
|
|
if (StringUtil.isBlank(aivo.getHospitalCode())) {
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院编码");
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院编码");
|
|
}
|
|
}
|
|
|
|
+ //判断症状个数
|
|
|
|
+ List<FeatureConceptDTO> featureConceptDTOList = featureFacade.getSymptomFeature(aivo.getSymptom());
|
|
|
|
+ Integer symptomSize = ListUtil.isEmpty(featureConceptDTOList) ? 0 : featureConceptDTOList.size();
|
|
|
|
+
|
|
RespDTO<ResponseDataWithExplain> res = aiptServiceClient.pushWithExplain(assembleData(aivo, type));
|
|
RespDTO<ResponseDataWithExplain> res = aiptServiceClient.pushWithExplain(assembleData(aivo, type));
|
|
RespDTOUtil.respNGDealCover(res, "中间层没有结果返回");
|
|
RespDTOUtil.respNGDealCover(res, "中间层没有结果返回");
|
|
SYFDTO syfdto = new SYFDTO();
|
|
SYFDTO syfdto = new SYFDTO();
|
|
@@ -341,10 +348,12 @@ public class AIFacade {
|
|
if (StringUtil.isBlank(syfDiseaseDeptDTO.getDept())) {
|
|
if (StringUtil.isBlank(syfDiseaseDeptDTO.getDept())) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ //输入症状不止一个
|
|
//第一个科室概率小于0.3,两个科室都推
|
|
//第一个科室概率小于0.3,两个科室都推
|
|
//第一个科室概率大于0.3,第二个科室概率大于等于0.15,两个都推
|
|
//第一个科室概率大于0.3,第二个科室概率大于等于0.15,两个都推
|
|
//第一个科室概率大于0.3,第二个科室概率小于0.15,只推第一个
|
|
//第一个科室概率大于0.3,第二个科室概率小于0.15,只推第一个
|
|
- if (items.size() == 1
|
|
|
|
|
|
+ if (symptomSize != 1
|
|
|
|
+ && items.size() == 1
|
|
&& Double.valueOf(items.get(0).getRate()) > 0.3d
|
|
&& Double.valueOf(items.get(0).getRate()) > 0.3d
|
|
&& Double.valueOf(syfDiseaseDeptDTO.getRate()) < 0.15d) {
|
|
&& Double.valueOf(syfDiseaseDeptDTO.getRate()) < 0.15d) {
|
|
break;
|
|
break;
|