|
@@ -41,7 +41,7 @@ public class BeHospitalizedAI extends ModelAI {
|
|
* Present_cx[现病史]
|
|
* Present_cx[现病史]
|
|
*/
|
|
*/
|
|
public static List<String> medicalTextType = Arrays.asList("FirstCourseRecord_cx", "PastFamily_cx", "PersonalHistory_cx", "HPIForCX_cx",
|
|
public static List<String> medicalTextType = Arrays.asList("FirstCourseRecord_cx", "PastFamily_cx", "PersonalHistory_cx", "HPIForCX_cx",
|
|
- "GeneralVital_cx", "chief_present", "Diagnoses_cx","Present_cx");
|
|
|
|
|
|
+ "GeneralVital_cx", "chief_present", "Diagnoses_cx", "Present_cx");
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
public static String outputs = "outputs";
|
|
public static String outputs = "outputs";
|
|
|
|
|
|
@@ -89,7 +89,7 @@ public class BeHospitalizedAI extends ModelAI {
|
|
}
|
|
}
|
|
//月经史
|
|
//月经史
|
|
String concatMenstrual = "";
|
|
String concatMenstrual = "";
|
|
- if(personal_text != null){
|
|
|
|
|
|
+ if (personal_text != null) {
|
|
if (personal_text.length() > 30) {
|
|
if (personal_text.length() > 30) {
|
|
concatMenstrual = personal_text.substring(personal_text.length() - 30);
|
|
concatMenstrual = personal_text.substring(personal_text.length() - 30);
|
|
} else {
|
|
} else {
|
|
@@ -169,6 +169,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//使用现病史结构
|
|
//使用现病史结构
|
|
EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
|
|
EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
|
|
PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
|
|
PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
|
|
@@ -184,6 +187,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//放置入inputinfo
|
|
//放置入inputinfo
|
|
EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
|
|
EntityProcessClinic entityProcessClinic = new EntityProcessClinic();
|
|
PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
|
|
PresentLabel presentLabel = entityProcessClinic.extractEntity(aiOut);
|
|
@@ -202,6 +208,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//家族史信息处理
|
|
//家族史信息处理
|
|
EntityProcessFamily entityProcess = new EntityProcessFamily();
|
|
EntityProcessFamily entityProcess = new EntityProcessFamily();
|
|
FamilyLabel familyLabel = entityProcess.extractEntity(aiOut);
|
|
FamilyLabel familyLabel = entityProcess.extractEntity(aiOut);
|
|
@@ -220,6 +229,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//家族史信息处理
|
|
//家族史信息处理
|
|
EntityProcessMarital entityProcess = new EntityProcessMarital();
|
|
EntityProcessMarital entityProcess = new EntityProcessMarital();
|
|
MaritalLabel maritalLabel = entityProcess.extractEntity(aiOut);
|
|
MaritalLabel maritalLabel = entityProcess.extractEntity(aiOut);
|
|
@@ -232,6 +244,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//放置入inputinfo
|
|
//放置入inputinfo
|
|
EntityProcessPast entityProcessPast = new EntityProcessPast();
|
|
EntityProcessPast entityProcessPast = new EntityProcessPast();
|
|
PastLabel pastLabel = entityProcessPast.extractEntity(aiOut);
|
|
PastLabel pastLabel = entityProcessPast.extractEntity(aiOut);
|
|
@@ -251,6 +266,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//个人史信息提取
|
|
//个人史信息提取
|
|
EntityProcessPersonal entityProcessPersonal = new EntityProcessPersonal();
|
|
EntityProcessPersonal entityProcessPersonal = new EntityProcessPersonal();
|
|
PersonalLabel personalLabel = entityProcessPersonal.extractEntity(aiOut);
|
|
PersonalLabel personalLabel = entityProcessPersonal.extractEntity(aiOut);
|
|
@@ -269,6 +287,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//月经史信息处理
|
|
//月经史信息处理
|
|
EntityProcessMenses entityProcess = new EntityProcessMenses();
|
|
EntityProcessMenses entityProcess = new EntityProcessMenses();
|
|
MenstrualLabel menstrualLabel = entityProcess.extractEntity(aiOut);
|
|
MenstrualLabel menstrualLabel = entityProcess.extractEntity(aiOut);
|
|
@@ -287,6 +308,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//诊断信息
|
|
//诊断信息
|
|
EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
|
|
EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
|
|
List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
|
|
List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
|
|
@@ -296,18 +320,18 @@ public class BeHospitalizedAI extends ModelAI {
|
|
initialDiagLabel.setDiags(diags);
|
|
initialDiagLabel.setDiags(diags);
|
|
inputInfo.getBeHospitalizedDoc().setInitialDiagLabel(initialDiagLabel);
|
|
inputInfo.getBeHospitalizedDoc().setInitialDiagLabel(initialDiagLabel);
|
|
|
|
|
|
-// //因为关系抽取未标注完成,先用规则
|
|
|
|
-// String diagString = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getText();
|
|
|
|
-// if (StringUtils.isNotEmpty(diagString)) {
|
|
|
|
-// String[] diagArray = diagString.split(",");
|
|
|
|
-// List<Diag> diags = new ArrayList<>();
|
|
|
|
-// for (String d : diagArray) {
|
|
|
|
-// Diag diag = DiagEnhancer.create(d);
|
|
|
|
-// diags.add(diag);
|
|
|
|
-// }
|
|
|
|
-// InitialDiagLabel initialDiagLabel = new InitialDiagLabel();
|
|
|
|
-// initialDiagLabel.setDiags(diags);
|
|
|
|
-// }
|
|
|
|
|
|
+ // //因为关系抽取未标注完成,先用规则
|
|
|
|
+ // String diagString = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getText();
|
|
|
|
+ // if (StringUtils.isNotEmpty(diagString)) {
|
|
|
|
+ // String[] diagArray = diagString.split(",");
|
|
|
|
+ // List<Diag> diags = new ArrayList<>();
|
|
|
|
+ // for (String d : diagArray) {
|
|
|
|
+ // Diag diag = DiagEnhancer.create(d);
|
|
|
|
+ // diags.add(diag);
|
|
|
|
+ // }
|
|
|
|
+ // InitialDiagLabel initialDiagLabel = new InitialDiagLabel();
|
|
|
|
+ // initialDiagLabel.setDiags(diags);
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -352,6 +376,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//诊断信息
|
|
//诊断信息
|
|
EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
|
|
EntityProcessDiag entityProcessDiag = new EntityProcessDiag();
|
|
List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
|
|
List<Diag> diags = entityProcessDiag.extractEntity(aiOut);
|
|
@@ -373,6 +400,9 @@ public class BeHospitalizedAI extends ModelAI {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
//放置入inputinfo
|
|
//放置入inputinfo
|
|
PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
|
|
PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
|
|
pacsLabel.setPacses(loadPacses(aiOut));
|
|
pacsLabel.setPacses(loadPacses(aiOut));
|