|
@@ -3,25 +3,56 @@ package com.lantone.qc.kernel.structure.ai.process;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.lantone.qc.kernel.structure.ai.model.EntityEnum;
|
|
import com.lantone.qc.kernel.structure.ai.model.EntityEnum;
|
|
import com.lantone.qc.kernel.structure.ai.model.Lemma;
|
|
import com.lantone.qc.kernel.structure.ai.model.Lemma;
|
|
-import com.lantone.qc.pub.model.entity.Diag;
|
|
|
|
-import com.lantone.qc.pub.model.entity.Family;
|
|
|
|
|
|
+import com.lantone.qc.pub.model.entity.Consanguineous;
|
|
|
|
+import com.lantone.qc.pub.model.entity.Fertility;
|
|
|
|
+import com.lantone.qc.pub.model.entity.MaritalStatus;
|
|
|
|
+import com.lantone.qc.pub.model.entity.Marryiage;
|
|
import com.lantone.qc.pub.model.label.MaritalLabel;
|
|
import com.lantone.qc.pub.model.label.MaritalLabel;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @ClassName : EntityProcessMarital
|
|
* @ClassName : EntityProcessMarital
|
|
- * @Description : 家族史
|
|
|
|
|
|
+ * @Description : 婚育史
|
|
* @Author : 楼辉荣
|
|
* @Author : 楼辉荣
|
|
* @Date: 2020-03-10 10:20
|
|
* @Date: 2020-03-10 10:20
|
|
*/
|
|
*/
|
|
public class EntityProcessMarital extends EntityProcess {
|
|
public class EntityProcessMarital extends EntityProcess {
|
|
public MaritalLabel extractEntity(JSONObject aiOut) {
|
|
public MaritalLabel extractEntity(JSONObject aiOut) {
|
|
MaritalLabel maritalLabel = new MaritalLabel();
|
|
MaritalLabel maritalLabel = new MaritalLabel();
|
|
- try {
|
|
|
|
- List<Lemma> familiesLemma = createEntityTree(aiOut, EntityEnum.RELATIVES.toString());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
-
|
|
|
|
|
|
+ //家属情况
|
|
|
|
+ EntityProcessFamily entityProcessFamily = new EntityProcessFamily();
|
|
|
|
+ maritalLabel.setFamily(entityProcessFamily.extractEntity(aiOut).getFamilies());
|
|
|
|
+ //读取近亲史所有本体及关联信息
|
|
|
|
+ List<Lemma> consanguineousLemmas = createEntityTree(aiOut, EntityEnum.NEAR_RELATION.toString());
|
|
|
|
+ for (Lemma lemma :consanguineousLemmas) {
|
|
|
|
+ Consanguineous consanguineous = new Consanguineous();
|
|
|
|
+ consanguineous.setName(lemma.getText());
|
|
|
|
+ if (lemma.isHaveChildren()) {
|
|
|
|
+ consanguineous.setNegative(findNegative(lemma));
|
|
|
|
+ }
|
|
|
|
+ maritalLabel.setConsanguineous(consanguineous);
|
|
|
|
+ }
|
|
|
|
+ //读取结婚年龄所有本体及关联信息
|
|
|
|
+ List<Lemma> marryiageLemmas = createEntityTree(aiOut, EntityEnum.MARRYIAGE.toString());
|
|
|
|
+ for (Lemma lemma :marryiageLemmas) {
|
|
|
|
+ Marryiage marryiage = new Marryiage();
|
|
|
|
+ marryiage.setName(lemma.getText());
|
|
|
|
+ maritalLabel.setMarryiage(marryiage);
|
|
|
|
+ }
|
|
|
|
+ //婚姻情况描述
|
|
|
|
+ List<Lemma> maritalStatusLemmas = createEntityTree(aiOut, EntityEnum.MARITAL_STATUS.toString());
|
|
|
|
+ for (Lemma lemma :maritalStatusLemmas) {
|
|
|
|
+ MaritalStatus maritalStatus = new MaritalStatus();
|
|
|
|
+ maritalStatus.setName(lemma.getText());
|
|
|
|
+ maritalLabel.setMaritalStatus(maritalStatus);
|
|
|
|
+ }
|
|
|
|
+ //生育情况描述
|
|
|
|
+ List<Lemma> fertilityLemmas = createEntityTree(aiOut, EntityEnum.BIRTH_HIS.toString());
|
|
|
|
+ for (Lemma lemma :fertilityLemmas) {
|
|
|
|
+ Fertility fertility = new Fertility();
|
|
|
|
+ fertility.setName(lemma.getText());
|
|
|
|
+ maritalLabel.setFertility(fertility);
|
|
}
|
|
}
|
|
return maritalLabel;
|
|
return maritalLabel;
|
|
}
|
|
}
|