Bläddra i källkod

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

kongwz 5 år sedan
förälder
incheckning
a8a319be6a

+ 12 - 9
graph-web/src/main/java/org/diagbot/graphWeb/work/GraphCalculate.java

@@ -154,32 +154,35 @@ public class GraphCalculate {
         String pacsOrder = searchData.getPacsOrder();
         //指标推送
         if (featureTypeList.contains("22") ) {
+            List<MedicalIndication> idns =new ArrayList<>();
 //            List<MedicalIndication> pacsMi = getPacsMi(pacsOrder, inputList,webDiag);
             Set<String> newindSet = new HashSet<>();
             Set<String> newindSet1 = new HashSet<>();
             //查找指标
             Set<String> indSet = neo4jAPI.getInd((String[]) inputList.toArray(new String[inputList.size()]));
-            if(indSet.contains("肾功能不全")){
-                for (String ind:indSet
-                     ) {
+            if(indSet != null && indSet.size()>0){
+                for (String ind:indSet) {
                     if("肾功能不全".equals(ind)){
                         newindSet.add(ind);
-
                     }else {
                         newindSet1.add(ind);
                     }
                 }
             }
+
+
             Map<String, String> indLiang =null;
             if(newindSet1 != null && newindSet1.size()>0){
                 indLiang =neo4jAPI.getIndLiang(newindSet1);
 
             }
             logger.info("featureTypeList 包含22,走指标推送!!!,图谱推出的指标为:" + indSet);
+            List<MedicalIndication> idn =null;
             if(newindSet.contains("肾功能不全")){
-                List<MedicalIndication> idn = neo4jAPI.getIdn(newindSet, age, sex);
-//                pacsMi.addAll(idn);
-                responseData.setMedicalIndications(idn);
+                idn = neo4jAPI.getIdn(newindSet, age, sex);
+                if(idn!= null && idn.size()>0){
+                    idns.addAll(idn);
+                }
             }
             if(newindSet1 != null && newindSet1.size()>0){
                 for (String ind:newindSet1
@@ -197,11 +200,11 @@ public class GraphCalculate {
                     medicalIndicationDetail.setContent(jsonObject);
                     ds.add(medicalIndicationDetail);
                     medicalIndication.setDetails(ds);
-                    boolean add = responseData.getMedicalIndications().add(medicalIndication);
+                    idns.add(medicalIndication);
 
                 }
             }
-//            responseData.setMedicalIndications(pacsMi);
+            responseData.setMedicalIndications(idns);
 
         }
 

+ 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;