|
@@ -19,14 +19,8 @@ import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.vo.PushVO;
|
|
|
import com.diagbot.vo.QuestionVO;
|
|
|
-import com.diagbot.web.DeptInfoController;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
-import com.sun.corba.se.impl.ior.OldJIDLObjectKeyTemplate;
|
|
|
-import com.sun.xml.internal.ws.config.metro.dev.FeatureReader;
|
|
|
-import org.aspectj.weaver.patterns.TypePatternQuestions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
@@ -59,8 +53,7 @@ public class PushFacade {
|
|
|
* @param pushVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public PushDTO push(PushVO pushVO) {
|
|
|
- PushDTO pushDTO = new PushDTO();
|
|
|
+ public ResponseData pushAI(PushVO pushVO) {
|
|
|
SearchData searchData = new SearchData();
|
|
|
searchData.setAge(pushVO.getAge());
|
|
|
searchData.setSymptom(pushVO.getSymptom());
|
|
@@ -82,19 +75,33 @@ public class PushFacade {
|
|
|
default:
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "性别参数错误");
|
|
|
}
|
|
|
- String featureType = pushVO.getFeatureType();
|
|
|
- String[] featureTypes = featureType.split(",|,");
|
|
|
- Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
|
|
|
|
|
|
searchData.setFeatureType(pushVO.getFeatureType());
|
|
|
searchData.setSysCode("1");
|
|
|
searchData.setLength(10);
|
|
|
|
|
|
Response<ResponseData> res = aiServiceClient.bayesPageData(searchData);
|
|
|
- List<FeatureRate> symptom = res.getData().getSymptom();
|
|
|
- List<FeatureRate> dis = res.getData().getDis();
|
|
|
- List<FeatureRate> pacs = res.getData().getPacs();
|
|
|
- List<FeatureRate> labs = res.getData().getLabs();
|
|
|
+ return res.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 内部推理
|
|
|
+ *
|
|
|
+ * @param pushVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public PushDTO pushInner(PushVO pushVO) {
|
|
|
+ PushDTO pushDTO = new PushDTO();
|
|
|
+ ResponseData data = pushAI(pushVO);
|
|
|
+
|
|
|
+ String featureType = pushVO.getFeatureType();
|
|
|
+ String[] featureTypes = featureType.split(",|,");
|
|
|
+ Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
|
|
|
+
|
|
|
+ List<FeatureRate> symptom = data.getSymptom();
|
|
|
+ List<FeatureRate> dis = data.getDis();
|
|
|
+ List<FeatureRate> pacs = data.getPacs();
|
|
|
+ List<FeatureRate> labs = data.getLabs();
|
|
|
|
|
|
Map<String, Object> symptomMap = list2Map(symptom);
|
|
|
Map<String, Object> vitalMap = new HashMap<>();
|