Browse Source

bug修正

wangyu 4 years ago
parent
commit
36ddbbeaab

+ 8 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/OperationAI.java

@@ -68,8 +68,14 @@ public class OperationAI extends ModelAI {
         OperationDiscussionLabel operationDiscussionLabel = entityProcessOperationDiscussion.extractEntity(aiOut);
         List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
         for (OperationDoc operationDoc : operationDocs) {
-            OperationDiscussionDoc operationDiscussionDoc = operationDoc.getOperationDiscussionDoc();
-            String text = operationDiscussionDoc.getText();
+            OperationDiscussionDoc operationDiscussionDoc = null;
+            String text = null;
+            if(operationDoc.getOperationDiscussionDoc() != null){
+                operationDiscussionDoc = operationDoc.getOperationDiscussionDoc();
+                if(StringUtil.isNotBlank(operationDiscussionDoc.getText())){
+                    text = operationDiscussionDoc.getText();
+                }
+            }
             if (StringUtil.isNotBlank(text) && StringUtil.isNotBlank(originalText) && text.equals(originalText)) {
                 operationDiscussionDoc.setOperationDiscussionLabel(operationDiscussionLabel);
                 break;

+ 14 - 12
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessLeaveHospital.java

@@ -44,6 +44,15 @@ public class EntityProcessLeaveHospital extends EntityProcess {
             noteses.add(notes);
         }
         leaveHospitalLabel.setNoteses(noteses);
+        //出院诊断
+        List<Lemma> diagLemmas = createEntityTree(aiOut, EntityEnum.DIEASE.toString());
+        List<Diag> diags = new ArrayList<>();
+        for (Lemma lemma : diagLemmas) {
+            Diag diag = new Diag();
+            diag.setHospitalDiagName(lemma.getText());
+            diags.add(diag);
+        }
+        leaveHospitalLabel.setDiags(diags);
         //医嘱
         List<Lemma> keyWordForDoctorAdvicesesLemmas = createEntityTree(aiOut, EntityEnum.KEY_WORD_FOR_DOCTOR_ADVICES.toString());
         List<Lemma> keyWordForPartLemmas = createEntityTree(aiOut, EntityEnum.KEY_WORD_FOR_PART.toString());
@@ -58,19 +67,12 @@ public class EntityProcessLeaveHospital extends EntityProcess {
                 }
             }
         }
-        //出院诊断
-        List<Lemma> diagLemmas = createEntityTree(aiOut, EntityEnum.DIEASE.toString());
-        List<Diag> diags = new ArrayList<>();
-        for (Lemma lemma : diagLemmas) {
-            Diag diag = new Diag();
-            diag.setHospitalDiagName(lemma.getText());
-            diags.add(diag);
+        if (keyWordForDoctorAdvicesesStart < minPart) {
+            String content = aiOut.getString("content");
+            String doctorAdviceContent = content.substring(keyWordForDoctorAdvicesesStart, minPart);
+            doctorAdvice.setName(doctorAdviceContent);
+            leaveHospitalLabel.setDoctorAdvices(doctorAdvice);
         }
-        leaveHospitalLabel.setDiags(diags);
-        String content = aiOut.getString("content");
-        String doctorAdviceContent = content.substring(keyWordForDoctorAdvicesesStart, minPart);
-        doctorAdvice.setName(doctorAdviceContent);
-        leaveHospitalLabel.setDoctorAdvices(doctorAdvice);
         //好转表现
         List<Lemma> betterFindingLemmas = createEntityTree(aiOut, EntityEnum.BETTER_FINDING.toString());
         List<BetterFinding> betterFindings = new ArrayList<>();