|
@@ -28,24 +28,36 @@ public class ParamsDataProxy {
|
|
|
|
|
|
if (!org.springframework.util.StringUtils.isEmpty(searchData.getSymptom())) {
|
|
|
List<Map<String, Object>> featuresList = fa.start(searchData.getSymptom(), FeatureType.FEATURE);
|
|
|
- paramFeatureInit(searchData, featuresList, "symptomFeatureList", FeatureType.FEATURE);
|
|
|
+ paramFeatureInit(searchData, featuresList);
|
|
|
+ //如果既往史中诊断信息,需要提取这个特征
|
|
|
+ featuresList = fa.start(searchData.getOther(), FeatureType.DIAG);
|
|
|
+ paramFeatureInit(searchData, featuresList);
|
|
|
+ }
|
|
|
+ if (!org.springframework.util.StringUtils.isEmpty(searchData.getDiag()) && org.springframework.util.StringUtils.isEmpty(searchData.getSymptom())) {
|
|
|
+ List<Map<String, Object>> featuresList = fa.start(searchData.getDiag(), FeatureType.DIAG);
|
|
|
+ paramFeatureInit(searchData, featuresList);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void paramFeatureInit(SearchData searchData, List<Map<String, Object>> featuresList, String property_list, FeatureType featureType) throws Exception {
|
|
|
+ /**
|
|
|
+ * 推送模型入参
|
|
|
+ *
|
|
|
+ * @param searchData
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ private void paramFeatureInit(SearchData searchData, List<Map<String, Object>> featuresList) throws Exception {
|
|
|
if (featuresList != null && featuresList.size() > 0) {
|
|
|
- BeanUtils.setProperty(searchData, property_list, featuresList);
|
|
|
-
|
|
|
+// BeanUtils.setProperty(searchData, property_list, featuresList);
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
Map<String, Object> featureMap = null;
|
|
|
for (int i = 0; i < featuresList.size(); i++) {
|
|
|
- Map<String, String> map = new HashMap<>();
|
|
|
featureMap = featuresList.get(i);
|
|
|
for (Map.Entry<String, Object> entry : featureMap.entrySet()) {
|
|
|
map.put(entry.getKey(), String.valueOf(entry.getValue()));
|
|
|
}
|
|
|
- map.put("featureType", String.valueOf(map.get("feature_type")));
|
|
|
- map.put("featureName", String.valueOf(map.get("feature_name")));
|
|
|
+ map.put("featureType", String.valueOf(featureMap.get("feature_type")));
|
|
|
+ map.put("featureName", String.valueOf(featureMap.get("feature_name")));
|
|
|
searchData.getInputs().put(map.get("feature_name"), map);
|
|
|
}
|
|
|
}
|