|
@@ -1,14 +1,19 @@
|
|
package com.lantone.qc.kernel.catalogue.firstpagerecord;
|
|
package com.lantone.qc.kernel.catalogue.firstpagerecord;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
|
+import com.lantone.qc.kernel.client.ChiefPresentSimilarityServiceClient;
|
|
|
|
+import com.lantone.qc.kernel.structure.ai.ModelAI;
|
|
import com.lantone.qc.pub.Content;
|
|
import com.lantone.qc.pub.Content;
|
|
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.doc.FirstPageRecordDoc;
|
|
import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -20,6 +25,9 @@ import java.util.Map;
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
public class FIRP0192 extends QCCatalogue {
|
|
public class FIRP0192 extends QCCatalogue {
|
|
|
|
+ @Autowired
|
|
|
|
+ ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient;
|
|
|
|
+
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
status.set("0");
|
|
status.set("0");
|
|
FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
|
|
FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
|
|
@@ -32,17 +40,29 @@ public class FIRP0192 extends QCCatalogue {
|
|
if (mapList != null && mapList.size() > 0) {
|
|
if (mapList != null && mapList.size() > 0) {
|
|
Map<String, String> op = mapList.get(0);
|
|
Map<String, String> op = mapList.get(0);
|
|
String oName = op.get(Content.operative_name);
|
|
String oName = op.get(Content.operative_name);
|
|
|
|
+ ModelAI modelAI = new ModelAI();
|
|
String operationName = "";
|
|
String operationName = "";
|
|
for (OperationDoc operationDoc : operationDocs) {
|
|
for (OperationDoc operationDoc : operationDocs) {
|
|
if (operationDoc.getOperationRecordDoc() != null) {
|
|
if (operationDoc.getOperationRecordDoc() != null) {
|
|
operationName = operationDoc.getOperationRecordDoc().getStructureMap().get("手术名称");
|
|
operationName = operationDoc.getOperationRecordDoc().getStructureMap().get("手术名称");
|
|
}
|
|
}
|
|
- if (StringUtil.isBlank(operationName) && operationDoc.getOperationDiscussionDoc() != null){
|
|
|
|
|
|
+ if (StringUtil.isBlank(operationName) && operationDoc.getOperationDiscussionDoc() != null) {
|
|
operationName = operationDoc.getOperationDiscussionDoc().getStructureMap().get("手术名称");
|
|
operationName = operationDoc.getOperationDiscussionDoc().getStructureMap().get("手术名称");
|
|
}
|
|
}
|
|
- if (StringUtil.isNotBlank(operationName) && !operationName.contains(oName)){
|
|
|
|
- status.set("-1");
|
|
|
|
- return;
|
|
|
|
|
|
+ if (StringUtil.isNotBlank(operationName)) {
|
|
|
|
+ String[] operationNames = operationName.split("\\+");
|
|
|
|
+ JSONArray jsonArray = modelAI.loadChiefPresentSimilarAI(oName, Arrays.asList(operationNames), false
|
|
|
|
+ , "operation", chiefPresentSimilarityServiceClient);
|
|
|
|
+ if (jsonArray.size() == 2) {
|
|
|
|
+ /* 相似度最高手术 */
|
|
|
|
+ String operation = jsonArray.getString(0);
|
|
|
|
+ /* 相似度分数 */
|
|
|
|
+ double likeRate = jsonArray.getDoubleValue(1);
|
|
|
|
+ if (likeRate < 0.9) {
|
|
|
|
+ status.set("-1");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|