Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/diagbot/model/ai/BeHospitalizedAI.java
zhoutg 4 rokov pred
rodič
commit
b1261e0954

+ 7 - 6
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -7,7 +7,6 @@ import com.diagbot.client.CRFServiceClient;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.enums.StandConvertEnum;
 import com.diagbot.model.ai.AIAnalyze;
-import com.diagbot.model.entity.PacsNew;
 import com.diagbot.model.label.*;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.ListUtil;
@@ -96,9 +95,10 @@ public class CommonFacade {
         //所有辅助检查(结构化数据)
         List<String> allPacs = new ArrayList<>();
 //        List<Pacs> pacs = wordCrfDTO.getPacs();
-        List<PacsNew> pacsNews = wordCrfDTO.getPacsLabel().getPacsNewList();
-        if (ListUtil.isNotEmpty(pacsNews)) {
-            List<String> pacss_unique = pacsNews.stream().filter(x -> StringUtils.isBlank(x.getUniqueName()))
+//        List<PacsNew> pacsNews = wordCrfDTO.getPacsLabel().getPacsNewList();
+        List<com.diagbot.model.entity.Pacs> pacses = wordCrfDTO.getPacsLabel().getPacses();
+        if (ListUtil.isNotEmpty(pacses)) {
+            List<String> pacss_unique = pacses.stream().filter(x -> StringUtils.isBlank(x.getStandName()))
                     .map(x -> x.getName()).collect(Collectors.toList());
             allPacs.addAll(pacss_unique);
         }
@@ -144,7 +144,8 @@ public class CommonFacade {
         DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
         List<Lis> lis = wordCrfDTO.getLis();
 //        List<Pacs> pacs = wordCrfDTO.getPacs();
-        List<PacsNew> pacsNews = wordCrfDTO.getPacsLabel().getPacsNewList();
+//        List<PacsNew> pacsNews = wordCrfDTO.getPacsLabel().getPacsNewList();
+        List<com.diagbot.model.entity.Pacs> pacses = wordCrfDTO.getPacsLabel().getPacses();
         VitalLabel vitalLabel = wordCrfDTO.getVitalLabel();
 
         //症状回填
@@ -161,7 +162,7 @@ public class CommonFacade {
         CoreUtil.setPropertyList(lis, "name", "detailName", "uniqueName", map.get(StandConvertEnum.lis.getName()));
         CoreUtil.setPropertyList(wordCrfDTO.getLisOrder(), "name", "detailName", "uniqueName", map.get(StandConvertEnum.lis.getName()));
         // TODO: 2020/8/5 辅助检查回填
-        CoreUtil.setPropertyList(pacsNews, "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
+        CoreUtil.setPropertyList(pacses,  map.get(StandConvertEnum.pacs.getName()));
         CoreUtil.setPropertyList(wordCrfDTO.getPacsOrder(), "name", "uniqueName", map.get(StandConvertEnum.pacs.getName()));
         //体征回填
         CoreUtil.setPropertyList(vitalLabel.getVitals(), map.get(StandConvertEnum.vital.getName()));

+ 3 - 3
src/main/java/com/diagbot/model/ai/process/EntityProcessClinic.java

@@ -94,9 +94,9 @@ public class EntityProcessClinic extends EntityProcess {
             presentLabel.setGenerals(generals);
 
             //辅检信息
-            EntityProcessPacs entityProcessLis = new EntityProcessPacs();
-            List<Pacs> pacses = entityProcessLis.extractEntity(aiOut);
-            presentLabel.setPacses(pacses);
+//            EntityProcessPacs entityProcessLis = new EntityProcessPacs();
+//            List<Pacs> pacses = entityProcessLis.extractEntity(aiOut);
+//            presentLabel.setPacses(pacses);
 
             //治疗
             List<Lemma> cureLemmas = createEntityTree(aiOut, EntityEnum.CURE.toString());

+ 26 - 2
src/main/java/com/diagbot/model/ai/process/EntityProcessPacs.java

@@ -4,29 +4,44 @@ import com.alibaba.fastjson.JSONObject;
 import com.diagbot.model.ai.model.EntityEnum;
 import com.diagbot.model.ai.model.Lemma;
 import com.diagbot.model.entity.*;
+import org.apache.commons.lang3.StringUtils;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 public class EntityProcessPacs extends EntityProcess {
 
-    public List<Pacs> extractEntity(JSONObject aiOut) {
+    public List<Pacs> extractEntity(JSONObject aiOut, Map<String, String> name_uniqueName) {
         //辅检情况
         List<Pacs> pacses = new ArrayList<>();
         List<Lemma> pacsLemmas = createEntityTree(aiOut, EntityEnum.AUXILIARY_EXAMINATION.toString());
         for (Lemma lemma : pacsLemmas) {
             Pacs pacs = new Pacs();
+            if(StringUtils.isBlank(lemma.getText().trim())){
+                continue;
+            }
             pacs.setName(lemma.getText());
+            if(name_uniqueName.containsKey(lemma.getText())){
+                pacs.setStandName(lemma.getText());
+            }
             if (lemma.isHaveChildren()) {
+                List<BodyPart> bodyPartList = new ArrayList<>();
+                List<Diag> diseaseList = new ArrayList<>();
                 for (Lemma relationLemma : lemma.getRelationLemmas()) {
                     if (relationLemma.getProperty().equals(EntityEnum.AUXILIARY_DESCRIPT.toString())) {
                         pacs.setPacsValues(addPacsValue(relationLemma));
                     } else if (relationLemma.getProperty().equals(EntityEnum.BODY.toString())) {
-                        pacs.setBodyPart(addBodyPart(relationLemma));
+                        bodyPartList.add(addBodyPart(relationLemma));
+//                        pacs.setBodyPart(addBodyPart(relationLemma));
+                    } else if(relationLemma.getProperty().equals(EntityEnum.DIEASE.toString())){
+                        diseaseList.add(addDiag(relationLemma));
                     } else if (relationLemma.getProperty().equals(EntityEnum.OUTERCOURTYARD.toString())) {
                         pacs.setOuterCourtyard(addOuterCourtyard(relationLemma));
                     }
                 }
+                pacs.setBodyPartList(bodyPartList);
+                pacs.setDisease(diseaseList);
             }
             pacses.add(pacs);
         }
@@ -51,6 +66,7 @@ public class EntityProcessPacs extends EntityProcess {
     private PacsValue addPacsValue(Lemma relationLemma) {
         PacsValue pacsValue = new PacsValue();
         pacsValue.setName(relationLemma.getText());
+        pacsValue.setStandName(relationLemma.getText());
         return pacsValue;
     }
 
@@ -63,6 +79,14 @@ public class EntityProcessPacs extends EntityProcess {
     private BodyPart addBodyPart(Lemma relationLemma) {
         BodyPart bodyPart = new BodyPart();
         bodyPart.setName(relationLemma.getText());
+        bodyPart.setStandName(relationLemma.getText());
+        return bodyPart;
+    }
+
+    private Diag addDiag(Lemma relationLemma) {
+        Diag bodyPart = new Diag();
+        bodyPart.setName(relationLemma.getText());
+        bodyPart.setStandName(relationLemma.getText());
         return bodyPart;
     }
 

+ 1 - 0
src/main/java/com/diagbot/model/entity/Pacs.java

@@ -19,5 +19,6 @@ public class Pacs extends General{
     private PacsValue pacsValues;
     private BodyPart bodyPart;
     private List<BodyPart> bodyPartList; // 部位列表
+    private List<Diag> disease;//辅检提的诊断
     private OuterCourtyard outerCourtyard; //外院
 }

+ 2 - 1
src/main/java/com/diagbot/model/label/PacsLabel.java

@@ -1,6 +1,7 @@
 package com.diagbot.model.label;
 
 
+import com.diagbot.model.entity.Pacs;
 import com.diagbot.model.entity.PacsNew;
 import lombok.Getter;
 import lombok.Setter;
@@ -17,6 +18,6 @@ import java.util.List;
 @Setter
 @Getter
 public class PacsLabel extends GeneralLabel {
-    // List<Pacs> pacses;
+     List<Pacs> pacses;
     List<PacsNew> pacsNewList = new ArrayList<>(); // 辅检信息
 }