Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/push-dev' into push-dev-indicators

kongwz 5 gadi atpakaļ
vecāks
revīzija
bc47334367

+ 2 - 2
nlp-web/src/main/java/org/diagbot/nlp/controller/FeatureController.java

@@ -84,7 +84,7 @@ public class FeatureController extends BaseController<Feature, FeatureWrapper, L
             for (int i = 0; i < properties.length; i++) {
                 if (NlpUtil.isFeature(properties[i], new NegativeEnum[]{NegativeEnum.SYMPTOM})) {
                     Map<String, String> map = new HashMap<>();
-                    map.put("conceptId", conceptIds[i]);
+//                    map.put("conceptId", conceptIds[i]);
                     map.put("name", lexeme.getText());
                     map.put("libType", NegativeEnum.SYMPTOM.toString());
                     map.put("chronicLabel", "0");
@@ -93,7 +93,7 @@ public class FeatureController extends BaseController<Feature, FeatureWrapper, L
                 if (NlpUtil.isFeature(properties[i], new NegativeEnum[]{NegativeEnum.DISEASE})) {
                     if ("慢病".equals(classifies.get(lexeme.getText()))) {
                         Map<String, String> map = new HashMap<>();
-                        map.put("conceptId", conceptIds[i]);
+//                        map.put("conceptId", conceptIds[i]);
                         map.put("name", lexeme.getText());
                         map.put("libType", NegativeEnum.DISEASE.toString());
                         map.put("chronicLabel", "0");

+ 15 - 9
nlp/src/main/java/org/diagbot/nlp/relation/analyze/StructureAnalyze.java

@@ -430,6 +430,7 @@ public class StructureAnalyze {
                     break;
                 case Constants.word_property_diagnose:
                 case Constants.word_property_med:
+                case Constants.word_property_med_com:
                 case Constants.word_property_treat:
                     current = updateClinicalInfo(outputInfo, lexeme.getText(), lexeme.getProperty());
                     updated = true;
@@ -603,12 +604,12 @@ public class StructureAnalyze {
                 Cause cause = new Cause();
                 cause.setCauseName(name);
 
-//                if (current instanceof Symptom) {
-//                    symptom = (Symptom)current;
-//                }
-//                else {
+                if (current instanceof Symptom) {
+                    symptom = (Symptom)current;
+                }
+                else {
                     symptom = outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1);
-//                }
+                }
 
                 if (symptom.getCause() != null) {
                     if (!outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).getSymptomName().equals(symptom.getSymptomName())) {
@@ -635,10 +636,14 @@ public class StructureAnalyze {
 //                    symptom = outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1);
                 }
 
-                else if (symptom.getDegree() != null) {
-                    if (!outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).getSymptomName().equals(symptom.getSymptomName())) {
-                        outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).setSymptomName(symptom.getSymptomName());
-                        symptom = outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1);
+                else if (current instanceof Symptom) {
+                    symptom = (Symptom)current;
+
+                    if (symptom.getDegree() != null) {
+                        if (!outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).getSymptomName().equals(symptom.getSymptomName())) {
+                            outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1).setSymptomName(symptom.getSymptomName());
+                            symptom = outputInfo.getSymptoms().get(outputInfo.getSymptoms().size() - 1);
+                        }
                     }
                     symptom.setDegree(degree);
 
@@ -698,6 +703,7 @@ public class StructureAnalyze {
                 }
                 break;
             case Constants.word_property_med:
+            case Constants.word_property_med_com:
                 if (current_treat instanceof Past || current instanceof Past) {
                     if (current_treat instanceof Past) {
                         past = (Past) current_treat;