|
@@ -5,14 +5,13 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.lantone.qc.kernel.client.CRFServiceClient;
|
|
|
import com.lantone.qc.kernel.structure.ai.model.CrfOut;
|
|
|
+import com.lantone.qc.kernel.structure.ai.model.EntityEnum;
|
|
|
import com.lantone.qc.kernel.structure.ai.process.*;
|
|
|
import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
|
|
|
import com.lantone.qc.pub.model.entity.*;
|
|
|
-import com.lantone.qc.pub.model.label.ChiefLabel;
|
|
|
-import com.lantone.qc.pub.model.label.PastLabel;
|
|
|
-import com.lantone.qc.pub.model.label.PresentLabel;
|
|
|
+import com.lantone.qc.pub.model.label.*;
|
|
|
import com.lantone.qc.pub.model.vo.CRFVo;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -87,6 +86,11 @@ public class BeHospitalizedAI {
|
|
|
putPresentCrfData(midData.getJSONObject(Content.present), inputInfo);
|
|
|
//处理既往史
|
|
|
putPastCrfData(midData.getJSONObject(Content.past), inputInfo);
|
|
|
+ //处理个人史
|
|
|
+ putPersonCrfData(midData.getJSONObject(Content.personal), inputInfo);
|
|
|
+ //处理家族史
|
|
|
+ putFamilyCrfData(midData.getJSONObject(Content.family),inputInfo);
|
|
|
+
|
|
|
|
|
|
|
|
|
// //存放CRF模型既往史、家族史返回数据
|
|
@@ -114,6 +118,7 @@ public class BeHospitalizedAI {
|
|
|
chiefLabel.setClinicals(loadClinicals(aiOut));
|
|
|
chiefLabel.setDiags(loadDiags(aiOut));
|
|
|
}
|
|
|
+
|
|
|
public void putPresentCrfData(JSONObject jsonObject, InputInfo inputInfo){
|
|
|
if (jsonObject == null) {
|
|
|
return;
|
|
@@ -125,6 +130,23 @@ public class BeHospitalizedAI {
|
|
|
presentLabel.setGenerals(loadGeneralDes(aiOut));
|
|
|
presentLabel.setPacses(loadpacses(aiOut));
|
|
|
}
|
|
|
+ public void putFamilyCrfData(JSONObject jsonObject, InputInfo inputInfo){
|
|
|
+ if (jsonObject == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
+ //放置入inputinfo
|
|
|
+ FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
|
|
|
+ familyLabel.setDiags(loadDiags(aiOut));
|
|
|
+ familyLabel.setFamilies(loadFamily(aiOut));
|
|
|
+ EntityProcess entityProcess = new EntityProcess();
|
|
|
+ try {
|
|
|
+ List<DiagInfectious> diagInfectious = entityProcess.addEntity(aiOut, EntityEnum.INFECTIOUS_KEYWORD, DiagInfectious.class);
|
|
|
+ familyLabel.setDiagInfectious(diagInfectious);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
public void putPastCrfData(JSONObject jsonObject, InputInfo inputInfo){
|
|
|
if (jsonObject == null) {
|
|
|
return;
|
|
@@ -134,6 +156,16 @@ public class BeHospitalizedAI {
|
|
|
EntityProcessPast entityProcessPast = new EntityProcessPast();
|
|
|
inputInfo.getBeHospitalizedDoc().setPastLabel(entityProcessPast.extractEntity(aiOut));
|
|
|
|
|
|
+ }
|
|
|
+ public void putPersonCrfData(JSONObject jsonObject, InputInfo inputInfo){
|
|
|
+ if (jsonObject == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
+ //放置入inputinfo
|
|
|
+ PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
|
|
|
+ personalLabel.setDiags(loadDiags(aiOut));
|
|
|
+
|
|
|
}
|
|
|
/**
|
|
|
* 关系抽取临床表现信息
|
|
@@ -146,7 +178,17 @@ public class BeHospitalizedAI {
|
|
|
List<Clinical> clinicals = entityProcessClinic.extractEntity(aiOut);
|
|
|
return clinicals;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 关系抽取临床表现信息
|
|
|
+ * @param aiOut
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<Family> loadFamily(JSONObject aiOut) {
|
|
|
|
|
|
+ EntityProcessFamily entityProcessFamily= new EntityProcessFamily();
|
|
|
+ List<Family> families = entityProcessFamily.extractEntity(aiOut);
|
|
|
+ return families;
|
|
|
+ }
|
|
|
/**
|
|
|
* 关系抽取疾病信息
|
|
|
* @param aiOut
|