|
@@ -38,9 +38,10 @@ public class BeHospitalizedAI {
|
|
|
* HPIForCX_cx[主诉、现病史、专科检查]
|
|
|
* GeneralVital_cx[一般体格检查]
|
|
|
* chief_present[邵逸夫医院主诉现病史]
|
|
|
+ * primary_diag[诊断]
|
|
|
*/
|
|
|
public static List<String> medicalTextType = Arrays.asList("FirstCourseRecord_cx", "PastFamily_cx", "PersonalHistory_cx", "HPIForCX_cx",
|
|
|
- "GeneralVital_cx", "chief_present");
|
|
|
+ "GeneralVital_cx", "chief_present", "Diagnoses_cx");
|
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
|
public static String outputs = "outputs";
|
|
|
|
|
@@ -54,6 +55,7 @@ public class BeHospitalizedAI {
|
|
|
String past_text = beHospitalizedDoc.getPastLabel().getText();
|
|
|
String present_text = beHospitalizedDoc.getPresentLabel().getText();
|
|
|
String pacs_text = beHospitalizedDoc.getPacsLabel().getText();
|
|
|
+ String initial_diag_text = beHospitalizedDoc.getInitialDiagLabel().getText();
|
|
|
//月经史
|
|
|
String menstrual_text = beHospitalizedDoc.getMenstrualLabel().getText();
|
|
|
//婚育史
|
|
@@ -81,11 +83,13 @@ public class BeHospitalizedAI {
|
|
|
if (Personal_text.length() > 30) {
|
|
|
concatMenstrual = Personal_text.substring(Personal_text.length() - 30);
|
|
|
}
|
|
|
- putContent(crfContent, medicalTextType.get(2), concatMenstrual + menstrual_text, Content.menses);
|
|
|
+ putContent(crfContent, medicalTextType.get(2), concatMenstrual, menstrual_text, Content.menses);
|
|
|
//婚育史
|
|
|
putContent(crfContent, medicalTextType.get(2), marital_text, Content.marriage);
|
|
|
//辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改)
|
|
|
putContent(crfContent, medicalTextType.get(3), pacs_text, Content.pacs);
|
|
|
+ //初步诊断
|
|
|
+ putContent(crfContent, medicalTextType.get(6), initial_diag_text, Content.initial_diag);
|
|
|
//存储CRF完整所需结构数据
|
|
|
CRFVo crfVo = new CRFVo();
|
|
|
crfVo.setData(crfContent);
|
|
@@ -110,6 +114,8 @@ public class BeHospitalizedAI {
|
|
|
putInitialDiagCrfData(midData.getJSONObject(Content.pridiag), inputInfo);
|
|
|
//处理辅助检查
|
|
|
putPacsCrfData(midData.getJSONObject(Content.pacs), inputInfo);
|
|
|
+ //处理疾病
|
|
|
+// putPrimaryDiagCrfData(midData.getJSONObject(Content.primary_diag), inputInfo);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -372,6 +378,19 @@ public class BeHospitalizedAI {
|
|
|
crfContent.add(detailContent);
|
|
|
}
|
|
|
|
|
|
+ public void putContent(JSONArray crfContent, String medicalTextType, String firstText, String secondText, String sign) {
|
|
|
+ String firstMoveText = CatalogueUtil.removeSpecialChar(firstText);
|
|
|
+ String secondMoveText = CatalogueUtil.removeSpecialChar(secondText);
|
|
|
+ if (StringUtil.isEmpty(firstMoveText) && StringUtil.isEmpty(secondMoveText)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONObject detailContent = new JSONObject();
|
|
|
+ detailContent.put("medical_text_type", medicalTextType);
|
|
|
+ detailContent.put("content", firstMoveText + "\n" + secondMoveText);
|
|
|
+ detailContent.put("detail_title", sign);
|
|
|
+ crfContent.add(detailContent);
|
|
|
+ }
|
|
|
+
|
|
|
private Annotation getAnnotation(CRFServiceClient crfServiceClient, CRFVo crfVo) {
|
|
|
|
|
|
Annotation annotation = new Annotation();
|