|
@@ -1,17 +1,18 @@
|
|
package com.lantone.qc.kernel.analysis;
|
|
package com.lantone.qc.kernel.analysis;
|
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
|
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
|
|
import com.lantone.qc.kernel.client.CRFServiceClient;
|
|
import com.lantone.qc.kernel.client.CRFServiceClient;
|
|
import com.lantone.qc.kernel.client.SimilarityServiceClient;
|
|
import com.lantone.qc.kernel.client.SimilarityServiceClient;
|
|
import com.lantone.qc.kernel.structure.ai.AIAnalyze;
|
|
import com.lantone.qc.kernel.structure.ai.AIAnalyze;
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
-import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
|
|
|
|
import com.lantone.qc.pub.exception.AIException;
|
|
import com.lantone.qc.pub.exception.AIException;
|
|
import com.lantone.qc.pub.exception.CatalogueException;
|
|
import com.lantone.qc.pub.exception.CatalogueException;
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.vo.QueryVo;
|
|
import com.lantone.qc.pub.model.vo.QueryVo;
|
|
import com.lantone.qc.trans.TransDispatch;
|
|
import com.lantone.qc.trans.TransDispatch;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -23,6 +24,7 @@ import java.util.Map;
|
|
* @Author : 楼辉荣
|
|
* @Author : 楼辉荣
|
|
* @Date: 2020-03-04 11:48
|
|
* @Date: 2020-03-04 11:48
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@Component
|
|
@Component
|
|
public class QCAnalysis {
|
|
public class QCAnalysis {
|
|
@Autowired
|
|
@Autowired
|
|
@@ -35,7 +37,9 @@ public class QCAnalysis {
|
|
public OutputInfo anlysis(QueryVo queryVo) throws AIException, CatalogueException, Exception {
|
|
public OutputInfo anlysis(QueryVo queryVo) throws AIException, CatalogueException, Exception {
|
|
specialStorageUtil.getHospitalIdThreadLocal().set(queryVo.getHospitalId());
|
|
specialStorageUtil.getHospitalIdThreadLocal().set(queryVo.getHospitalId());
|
|
OutputInfo outputInfo = new OutputInfo();
|
|
OutputInfo outputInfo = new OutputInfo();
|
|
|
|
+ long t1 = System.currentTimeMillis();
|
|
InputInfo inputInfo = TransDispatch.trans(queryVo);
|
|
InputInfo inputInfo = TransDispatch.trans(queryVo);
|
|
|
|
+ long t2 = System.currentTimeMillis();
|
|
inputInfo.setUseCrfCache(queryVo.isUseCrfCache());
|
|
inputInfo.setUseCrfCache(queryVo.isUseCrfCache());
|
|
inputInfo.setInputCatalogueMap(queryVo.getInputCatalogueMap());
|
|
inputInfo.setInputCatalogueMap(queryVo.getInputCatalogueMap());
|
|
AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient, similarityServiceClient);
|
|
AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient, similarityServiceClient);
|
|
@@ -44,12 +48,19 @@ public class QCAnalysis {
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new AIException("AI模型执行错误:" + e.getMessage());
|
|
throw new AIException("AI模型执行错误:" + e.getMessage());
|
|
}
|
|
}
|
|
|
|
+ long t3 = System.currentTimeMillis();
|
|
for (Map.Entry<String, Map<String, String>> entry : inputInfo.getInputCatalogueMap().entrySet()) {
|
|
for (Map.Entry<String, Map<String, String>> entry : inputInfo.getInputCatalogueMap().entrySet()) {
|
|
if (CatalogueUtil.qcCatalogueMap.get(entry.getKey()) == null) {
|
|
if (CatalogueUtil.qcCatalogueMap.get(entry.getKey()) == null) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
CatalogueUtil.qcCatalogueMap.get(entry.getKey()).execute(inputInfo, outputInfo);
|
|
CatalogueUtil.qcCatalogueMap.get(entry.getKey()).execute(inputInfo, outputInfo);
|
|
}
|
|
}
|
|
|
|
+ long t4 = System.currentTimeMillis();
|
|
|
|
+
|
|
|
|
+ log.error(queryVo.getBehospitalInfo().getBehospitalCode() + "-----" + "trans层 耗时:" + (t2 - t1));
|
|
|
|
+ log.error(queryVo.getBehospitalInfo().getBehospitalCode() + "-----" + "CRF 耗时:" + (t3 - t2));
|
|
|
|
+ log.error(queryVo.getBehospitalInfo().getBehospitalCode() + "-----" + "所有规则 耗时:" + (t4 - t3));
|
|
|
|
+
|
|
outputInfo.setPageData(inputInfo.getPageData());
|
|
outputInfo.setPageData(inputInfo.getPageData());
|
|
Map<String, Map<String, String>> result = outputInfo.getResult();
|
|
Map<String, Map<String, String>> result = outputInfo.getResult();
|
|
Map<String, Map<String, String>> resultNew = Maps.newHashMap();
|
|
Map<String, Map<String, String>> resultNew = Maps.newHashMap();
|