|
@@ -3,16 +3,22 @@ package com.lantone.qc.kernel.structure.ai.process;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.lantone.qc.kernel.structure.ai.model.EntityEnum;
|
|
|
import com.lantone.qc.kernel.structure.ai.model.Lemma;
|
|
|
+import com.lantone.qc.kernel.util.DiagEnhancer;
|
|
|
import com.lantone.qc.pub.model.entity.BodyPart;
|
|
|
+import com.lantone.qc.pub.model.entity.Diag;
|
|
|
import com.lantone.qc.pub.model.entity.OuterCourtyard;
|
|
|
import com.lantone.qc.pub.model.entity.PD;
|
|
|
import com.lantone.qc.pub.model.entity.Pacs;
|
|
|
import com.lantone.qc.pub.model.entity.PacsValue;
|
|
|
+import com.lantone.qc.pub.model.entity.Possible;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
public class EntityProcessPacs extends EntityProcess {
|
|
|
+ private Logger logger = LoggerFactory.getLogger(EntityProcessPacs.class);
|
|
|
|
|
|
public List<Pacs> extractEntity(JSONObject aiOut) {
|
|
|
//辅检情况
|
|
@@ -34,12 +40,32 @@ public class EntityProcessPacs extends EntityProcess {
|
|
|
}
|
|
|
pacses.add(pacs);
|
|
|
}
|
|
|
+ //辅检提取疾病
|
|
|
+ List<Diag> diags = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ //读取疾病信息
|
|
|
+ List<Lemma> diagLemmas = createEntityTree(aiOut, EntityEnum.DIEASE.toString());
|
|
|
+ for (Lemma lemma : diagLemmas) {
|
|
|
+ Diag diag = DiagEnhancer.create(lemma.getText());
|
|
|
+ if (lemma.isHaveChildren()) {
|
|
|
+ diag.setNegative(findNegative(lemma));//阴性
|
|
|
+ diag.setPossible(findT(lemma, new Possible(), EntityEnum.POSSIBLE.toString()));//可能的
|
|
|
+ diag.setPd(findT(lemma, new PD(), EntityEnum.TIME.toString()));//时间
|
|
|
+ }
|
|
|
+ diags.add(diag);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ Pacs pacs = new Pacs();
|
|
|
+ pacs.setDiags(diags);
|
|
|
+ pacses.add(pacs);
|
|
|
//辅检时间(不是辅检具体项目时间)
|
|
|
List<Lemma> pdLemmas = createEntityTree(aiOut, EntityEnum.TIME.toString());
|
|
|
for (Lemma lemma : pdLemmas) {
|
|
|
PD pd = new PD();
|
|
|
pd.setName(lemma.getText());
|
|
|
- Pacs pacs = new Pacs();
|
|
|
+ pacs = new Pacs();
|
|
|
pacs.setPd(pd);
|
|
|
pacses.add(pacs);
|
|
|
}
|