|
@@ -4,12 +4,15 @@ import com.diagbot.client.StandConvertServiceClient;
|
|
|
import com.diagbot.dto.IndicationDTO;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
|
import com.diagbot.util.CoreUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.vo.IndicationPushVO;
|
|
|
import com.diagbot.vo.StandConvert;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -30,6 +33,15 @@ public class IndicationFacade {
|
|
|
@Autowired
|
|
|
StandConvertServiceClient standConvertServiceClient;
|
|
|
|
|
|
+ private static final Map<String, List<String>> methodMap;
|
|
|
+
|
|
|
+ static {
|
|
|
+ methodMap = new HashMap<>();
|
|
|
+ methodMap.put("2", Arrays.asList("M1", "M2"));
|
|
|
+ methodMap.put("3", Arrays.asList());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 病情提示总入口
|
|
|
*
|
|
@@ -37,21 +49,38 @@ public class IndicationFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public IndicationDTO indicationFac(IndicationPushVO indicationPushVO) {
|
|
|
+ //方法适配处理
|
|
|
+ List<String> ruleTypeList = Arrays.asList(indicationPushVO.getRuleType().split(","));
|
|
|
+ List<String> methodList = new ArrayList<>();
|
|
|
+ for (String ruleType : ruleTypeList) {
|
|
|
+ if (ListUtil.isNotEmpty(methodMap.get(ruleType))) {
|
|
|
+ List<String> methods = methodMap.get(ruleType);
|
|
|
+ for (String method : methods) {
|
|
|
+ if (!methodList.contains(method)) {
|
|
|
+ methodList.add(method);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
IndicationDTO res = new IndicationDTO();
|
|
|
+ WordCrfDTO wordCrfDTO = null;
|
|
|
long l1 = System.currentTimeMillis();
|
|
|
- // 模型处理数据
|
|
|
- WordCrfDTO wordCrfDTO = commonFacade.crf_process(indicationPushVO);
|
|
|
- CoreUtil.getDubugStr(l1, "处理模型数据", res.getDubugStr());
|
|
|
-
|
|
|
- // 标准词转换
|
|
|
- long l2 = System.currentTimeMillis();
|
|
|
- StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
|
|
|
- Map<String, Map<String, String>> standConvertMap = neoFacade.standConvertCrf(standConvert);
|
|
|
-// Map<String, Map<String, String>> standConvertMap = neoFacade.standConvert(standConvert);
|
|
|
- commonFacade.dataTypeSet(wordCrfDTO, standConvertMap);
|
|
|
- CoreUtil.getDubugStr(l2, "同义词转换", res.getDubugStr());
|
|
|
+ if (methodList.contains("M1")) {
|
|
|
+ // 模型处理数据
|
|
|
+ wordCrfDTO = commonFacade.crf_process(indicationPushVO);
|
|
|
+ CoreUtil.getDubugStr(l1, "处理模型数据", res.getDubugStr());
|
|
|
+ }
|
|
|
|
|
|
- List<String> ruleTypeList = Arrays.asList(indicationPushVO.getRuleType().split(","));
|
|
|
+ if (methodList.contains("M2")) {
|
|
|
+ // 标准词转换
|
|
|
+ long l2 = System.currentTimeMillis();
|
|
|
+ StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
|
|
|
+ Map<String, Map<String, String>> standConvertMap = neoFacade.standConvertCrf(standConvert);
|
|
|
+ // Map<String, Map<String, String>> standConvertMap = neoFacade.standConvert(standConvert);
|
|
|
+ commonFacade.dataTypeSet(wordCrfDTO, standConvertMap);
|
|
|
+ CoreUtil.getDubugStr(l2, "同义词转换", res.getDubugStr());
|
|
|
+ }
|
|
|
|
|
|
long l3 = System.currentTimeMillis();
|
|
|
// 开单合理性
|