|
@@ -5,8 +5,10 @@ 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.ConceptPushDTO;
|
|
|
import com.diagbot.dto.DiseaseDeptDTO;
|
|
|
+import com.diagbot.dto.FeatureRateDTO;
|
|
|
import com.diagbot.dto.HospitalDeptDTO;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
@@ -205,22 +207,22 @@ public class AIV2Facade {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 邵逸夫诊断推理
|
|
|
+ * 纳里诊断推理
|
|
|
*
|
|
|
* @param aivo
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
- public SYFDTO pushDisForNaliV2(AIVO aivo, String type) {
|
|
|
+ public AIDTO pushDisForNaliV2(AIVO aivo, String type) {
|
|
|
+ AIDTO aidto = new AIDTO();
|
|
|
+ List<FeatureRateDTO> items = Lists.newLinkedList();
|
|
|
if (StringUtil.isBlank(aivo.getHospitalCode())) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院编码");
|
|
|
}
|
|
|
RespDTO<ResponseDataWithExplainV2> res
|
|
|
= aiptServiceClient.pushWithExplainV2(assembleFacade.assembleData(aivo, type));
|
|
|
RespDTOUtil.respNGDealCover(res, "中间层没有结果返回");
|
|
|
- SYFDTO syfdto = new SYFDTO();
|
|
|
|
|
|
- List<SYFDiseaseDeptDTO> items = Lists.newLinkedList();
|
|
|
List<FeatureRateV2> dis = res.data.getDis();
|
|
|
if (ListUtil.isNotEmpty(dis)) {
|
|
|
Map<String, List<SYFFeatureDTO>> disFeatureMap = new LinkedHashMap<>();
|
|
@@ -295,7 +297,7 @@ public class AIV2Facade {
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
if (ListUtil.isEmpty(featureRateList)) {
|
|
|
- return syfdto;
|
|
|
+ return aidto;
|
|
|
}
|
|
|
|
|
|
//获取对接科室
|
|
@@ -314,38 +316,20 @@ public class AIV2Facade {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //返回前两个科室,如果大科室相同则合并
|
|
|
- List<SYFFeatureDTO> syfFeatureDTOList = featureRateList
|
|
|
- .stream()
|
|
|
- .filter(i -> StringUtil.isNotBlank(i.getConcatDept()))
|
|
|
- .limit(2)
|
|
|
- .collect(Collectors.toList());
|
|
|
- Map<String, List<SYFFeatureDTO>> featureMap
|
|
|
- = EntityUtil.makeEntityListMap(syfFeatureDTOList, "concatDept");
|
|
|
-
|
|
|
- for (Map.Entry<String, List<SYFFeatureDTO>> entry : featureMap.entrySet()) {
|
|
|
- SYFDiseaseDeptDTO item = new SYFDiseaseDeptDTO();
|
|
|
- BeanUtil.copyProperties(entry.getValue().get(0), item);
|
|
|
- item.setDiseaseNames(entry.getValue()
|
|
|
- .stream()
|
|
|
- .map(i -> i.getDiseaseName())
|
|
|
- .distinct()
|
|
|
- .collect(Collectors.toList()));
|
|
|
- item.setDept(entry.getKey());
|
|
|
- items.add(item);
|
|
|
+ //返回前两个科室,如果科室相同则去重
|
|
|
+ if (ListUtil.isNotEmpty(featureRateList)) {
|
|
|
+ for (SYFFeatureDTO syfFeatureDTO : featureRateList) {
|
|
|
+ if (items.size() == 0
|
|
|
+ || (items.size() == 1 && !items.get(0).getExtraProperty().equals(syfFeatureDTO.getDeptName()))) {
|
|
|
+ FeatureRateDTO featureRateDTO = new FeatureRateDTO();
|
|
|
+ featureRateDTO.setExtraProperty(syfFeatureDTO.getDeptName());
|
|
|
+ featureRateDTO.setHospitalDepts(syfFeatureDTO.getHospitalDepts());
|
|
|
+ items.add(featureRateDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- //按大科室分组展示
|
|
|
- Map<String, List<SYFDiseaseDeptDTO>> itemMap = EntityUtil.makeEntityListMap(items, "deptName");
|
|
|
- List<SYFDeptDTO> syfDeptDTOList = Lists.newLinkedList();
|
|
|
- itemMap.entrySet().forEach(item -> {
|
|
|
- SYFDeptDTO syfDeptDTO = new SYFDeptDTO();
|
|
|
- syfDeptDTO.setDeptName(item.getKey());
|
|
|
- syfDeptDTO.setDeptCode(item.getValue().get(0).getDeptCode());
|
|
|
- syfDeptDTO.setDiseaseDept(item.getValue());
|
|
|
- syfDeptDTOList.add(syfDeptDTO);
|
|
|
- });
|
|
|
- syfdto.setDiseaseDept(syfDeptDTOList);
|
|
|
- return syfdto;
|
|
|
+ aidto.setItems(items);
|
|
|
+ return aidto;
|
|
|
}
|
|
|
}
|