瀏覽代碼

1、现病史抽取所有时间实体

louhr 5 年之前
父節點
當前提交
13d83e7df3

+ 3 - 3
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java

@@ -94,9 +94,9 @@ public class EntityProcess {
             for (Relation relation : connectEntityIdList) {
             for (Relation relation : connectEntityIdList) {
                 if (l.getId() == relation.getId()) {
                 if (l.getId() == relation.getId()) {
                     l.setRelationName(relation.getRelationName());
                     l.setRelationName(relation.getRelationName());
-//                    if (!hasRelation(l.getId(), lemma.getId(), relationIds)) {
-//                        findRelationLemma(l, allLemmaList, relations, relationIds);
-//                    }
+                    if (!hasRelation(l.getId(), lemma.getId(), relationIds)) {
+                        findRelationLemma(l, allLemmaList, relations, relationIds);
+                    }
                     lemma.addRelationLemmas(l);
                     lemma.addRelationLemmas(l);
                 }
                 }
             }
             }

+ 10 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessClinic.java

@@ -92,6 +92,16 @@ public class EntityProcessClinic extends EntityProcess {
             }
             }
             presentLabel.setTreats(treats);
             presentLabel.setTreats(treats);
 
 
+            //时间
+            List<Lemma> pdLemmas = createEntityTree(aiOut, EntityEnum.TIME.toString());
+            List<PD> pds = new ArrayList<>();
+            for (Lemma lemma : pdLemmas) {
+                PD pd = new PD();
+                pd.setName(lemma.getText());
+                pds.add(pd);
+            }
+            presentLabel.setPds(pds);
+
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
             logger.error(e.getMessage(), e);
             logger.error(e.getMessage(), e);

+ 2 - 0
public/src/main/java/com/lantone/qc/pub/model/label/PresentLabel.java

@@ -30,6 +30,8 @@ public class PresentLabel extends GeneralLabel {
     private List<Diag> diags = new ArrayList<>();
     private List<Diag> diags = new ArrayList<>();
     //入院途径
     //入院途径
     private BeHospitalizedWay beHospitalizedWay;
     private BeHospitalizedWay beHospitalizedWay;
+    //现病史中所有时间实体存入
+    private List<PD> pds = new ArrayList<>();
 
 
     public <T> void add(List<T> list, T obj) {
     public <T> void add(List<T> list, T obj) {
         list.add(obj);
         list.add(obj);