Pārlūkot izejas kodu

入院记录crf调整

chengyao 4 gadi atpakaļ
vecāks
revīzija
833b2130a2

+ 10 - 3
structure-center/src/main/java/com/lantone/structure/ai/BeHospitalizedAI.java

@@ -157,14 +157,21 @@ public class BeHospitalizedAI extends ModelAI {
                 if (midData.get(Content.pastLabel) != null)
                     EZAllCrfData(midData.getJSONObject(Content.pastLabel), inputInfo);
                      beHospitalizedDocs = inputInfo.getBeHospitalizedDoc();
-                beHospitalizedDocs.getPastLabel().setDiagInfectiouses(null);
+                List<DiagInfectious> flagDia = beHospitalizedDocs.getPastLabel().getDiagInfectiouses();
                 /* 恩泽传染病史 */
                 if (midData.get(familyLabel) != null) {
                     EZAllCrfData(midData.getJSONObject(familyLabel), inputInfo);
                     List<DiagInfectious> diagInfectiouses = inputInfo.getBeHospitalizedDoc().getPastLabel().getDiagInfectiouses();
-                    if(ListUtil.isNotEmpty(diagInfectiouses)){
-                        beHospitalizedDocs.getPastLabel().setDiagInfectiouses(diagInfectiouses);
+                    if(ListUtil.isNotEmpty(flagDia) && ListUtil.isNotEmpty(diagInfectiouses)){
+                        for (DiagInfectious diagInfectiouse : diagInfectiouses) {
+                            flagDia.add(diagInfectiouse);
+                        }
+                    }else {
+                        if(ListUtil.isNotEmpty(diagInfectiouses)){
+                            flagDia = diagInfectiouses;
+                        }
                     }
+                    beHospitalizedDocs.getPastLabel().setDiagInfectiouses(flagDia);
                     inputInfo.setBeHospitalizedDoc(beHospitalizedDocs);
                 }
             }

+ 11 - 4
structure-center/src/main/java/com/lantone/structure/ai/process/EntityProcessEZaAll.java

@@ -75,10 +75,10 @@ public class EntityProcessEZaAll extends EntityProcess {
             Set<String> diagSet = new HashSet<>();
             Set<String> diagRetSet = new HashSet<>();
             List<Lemma> diagList = createEntityTree(aiOut, EntityEnum.NEGATIVE.toString());
-            if( ListUtil.isEmpty(diagList)){
+           /* if( ListUtil.isEmpty(diagList)){
                 //时间
                 diagList = createEntityTree(aiOut, EntityEnum.TIME.toString());
-            }
+            }*/
             for (Lemma lemma : diagList) {
                 Diag diagFir = new Diag();
                 String text = lemma.getText();
@@ -99,11 +99,15 @@ public class EntityProcessEZaAll extends EntityProcess {
 
             //肯定
             List<Lemma>  diaList = createEntityTree(aiOut, EntityEnum.DIEASE.toString());
+            List<Lemma>  diaTimeList = createEntityTree(aiOut, EntityEnum.TIME.toString());
             if(ListUtil.isEmpty(diaList)){
                 diaList = createEntityTree(aiOut, EntityEnum.INJURY.toString());
             }
             for (Lemma lemma : diaList) {
                     if(!diagSet.contains(lemma.getText())){
+                        if(diaTimeList.size()==1 && diaList.size()==1){
+                            diagRetSet.add(diaTimeList.get(0).getText()+lemma.getText());
+                        }
                         diagRetSet.add(lemma.getText());
                     }
             }
@@ -204,7 +208,10 @@ public class EntityProcessEZaAll extends EntityProcess {
                     for (String allergySecs : allergieRetSet) {
                         Allergy allergySec = new Allergy();
                         allergySec.setName(allergySecs);
-                        String flagName = allergies.get(allergies.size() - 1).getName();
+                        String flagName = "";
+                        if(allergies.size()>0) {
+                            flagName = allergies.get(allergies.size() - 1).getName();
+                        }
                         if(flagName.contains(allergySecs)){
                             continue;
                         }else {
@@ -278,7 +285,7 @@ public class EntityProcessEZaAll extends EntityProcess {
                             Operation operationSec = new Operation();
                             //手术史
                             if (relationLemmaRec.getProperty().equals(EntityEnum.TIME.toString())) {
-                               String firText =text+relationLemmaRec.getText()+"病史";
+                               String firText ="手术时间:"+relationLemmaRec.getText()+"、"+"手术:"+text;
                                 operationSec.setName(firText);
                                 operations.add(operationSec);
                             }