Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

rengb vor 5 Jahren
Ursprung
Commit
df2a178f4b

+ 3 - 2
kernel/src/main/java/com/lantone/qc/kernel/analysis/QCAnalysis.java

@@ -37,10 +37,11 @@ public class QCAnalysis {
         OutputInfo outputInfo = new OutputInfo();
         InputInfo inputInfo = TransDispatch.trans(queryVo);
         inputInfo.setInputCatalogueMap(queryVo.getInputCatalogueMap());
-        AIAnalyze AIAnalyze = new AIAnalyze(crfServiceClient, similarityServiceClient);
+        AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient, similarityServiceClient);
         try{
-            AIAnalyze.AIprocess(inputInfo);
+            aiAnalyze.aiProcess(inputInfo);
         }catch (Exception e){
+            e.printStackTrace();
         }
         for (Map.Entry<String, Map<String, String>> entry : inputInfo.getInputCatalogueMap().entrySet()) {
             if (CatalogueUtil.qcCatalogueMap.get(entry.getKey()) == null) {

+ 20 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/QCCatalogue.java

@@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
 import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
 import lombok.extern.slf4j.Slf4j;
 
 import java.text.ParseException;
@@ -31,6 +32,7 @@ public class QCCatalogue {
         if (outputInfo.getResult().get(className) != null) {
             return;
         }
+        precondExecute(inputInfo, outputInfo);
         try {
             start(inputInfo, outputInfo);
         } catch (Exception e) {
@@ -55,4 +57,22 @@ public class QCCatalogue {
         info = "";
     }
 
+    //前置条件运行
+    private void precondExecute(InputInfo inputInfo, OutputInfo outputInfo) {
+        Map<String, String> catalogueMap = inputInfo.getInputCatalogueMap().get(className);
+        if (catalogueMap == null) {
+            return;
+        }
+        String precond = catalogueMap.get("precond");
+        if (StringUtil.isBlank(precond)) {
+            return;
+        }
+        for (String i : precond.split(",")) {
+            QCCatalogue qCCatalogue = CatalogueUtil.qcCatalogueMap.get(i);
+            if (qCCatalogue != null) {
+                qCCatalogue.execute(inputInfo, outputInfo);
+            }
+        }
+    }
+
 }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/AIAnalyze.java

@@ -24,7 +24,7 @@ public class AIAnalyze {
         this.similarityServiceClient = similarityServiceClient;
     }
 
-    public void AIprocess(InputInfo inputInfo) {
+    public void aiProcess(InputInfo inputInfo) {
         beHospitalizedAI.medrec(inputInfo, crfServiceClient);
         firstCourseRecordAI.medrec(inputInfo, crfServiceClient, similarityServiceClient);
         leaveHospitalAI.medrec(inputInfo, crfServiceClient);

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ModelAI.java

@@ -56,7 +56,7 @@ public class ModelAI {
             return new JSONObject();
         }
         JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(outputs);
-        aiOut.put(content, jsonObject.getJSONObject(entityRelationObject).getJSONObject(content));
+        aiOut.put(content, jsonObject.getJSONObject(entityRelationObject).getString(content));
         return aiOut;
     }