|
@@ -13,7 +13,6 @@ import com.lantone.qc.kernel.structure.ai.process.EntityProcessPacs;
|
|
|
import com.lantone.qc.kernel.structure.ai.process.EntityProcessPast;
|
|
|
import com.lantone.qc.kernel.structure.ai.process.EntityProcessPersonal;
|
|
|
import com.lantone.qc.kernel.structure.ai.process.EntityProcessVital;
|
|
|
-import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
|
|
@@ -31,7 +30,6 @@ import com.lantone.qc.pub.model.label.PastLabel;
|
|
|
import com.lantone.qc.pub.model.label.PersonalLabel;
|
|
|
import com.lantone.qc.pub.model.label.PresentLabel;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Arrays;
|
|
@@ -54,9 +52,10 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
* chief_present[邵逸夫医院主诉]
|
|
|
* Diagnoses_cx[诊断]
|
|
|
* Present_cx[现病史]
|
|
|
+ * DiagnoseInAssistant[辅助检查]
|
|
|
*/
|
|
|
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", "DiagnoseInAssistant");
|
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
|
public static String outputs = "outputs";
|
|
|
|
|
@@ -105,15 +104,16 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
String familyText = beHospitalizedDoc.getFamilyLabel().getText();
|
|
|
putContent(crfContent, medicalTextType.get(1), familyText, Content.family);
|
|
|
}
|
|
|
- /* 辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改) */
|
|
|
+ /* 辅助检查 */
|
|
|
if (beHospitalizedDoc.getPacsLabel() != null && beHospitalizedDoc.getPacsLabel().isCrfLabel()) {
|
|
|
String pacsText = beHospitalizedDoc.getPacsLabel().getText();
|
|
|
- putContent(crfContent, medicalTextType.get(3), pacsText, Content.pacs);
|
|
|
+ putContent(crfContent, medicalTextType.get(3), pacsText, Content.pacs + "含时间地点");
|
|
|
+ putContent(crfContent, medicalTextType.get(8), pacsText, Content.pacs);
|
|
|
}
|
|
|
/* 专科检查(专科体格检查) */
|
|
|
if (beHospitalizedDoc.getVitalLabelSpecial() != null && beHospitalizedDoc.getVitalLabelSpecial().isCrfLabel()) {
|
|
|
String vitalSpecialText = beHospitalizedDoc.getVitalLabelSpecial().getText();
|
|
|
- putContent(crfContent, medicalTextType.get(3), vitalSpecialText, Content.special_exam);
|
|
|
+ putContent(crfContent, medicalTextType.get(7), vitalSpecialText, Content.special_exam);
|
|
|
}
|
|
|
/* 一般体格检查(存放一般查体) */
|
|
|
if (beHospitalizedDoc.getVitalLabel() != null && beHospitalizedDoc.getVitalLabel().isCrfLabel()) {
|
|
@@ -154,6 +154,7 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
/* 处理现病史 */
|
|
|
if (beHospitalizedDoc.getPresentLabel() != null && beHospitalizedDoc.getPresentLabel().isCrfLabel()) {
|
|
|
putPresentCrfData(midData.getJSONObject(Content.present), inputInfo);
|
|
|
+ beHospitalizedDoc.getPresentLabel().setCrfOutput(midData.getJSONObject(Content.present));
|
|
|
}
|
|
|
/* 处理既往史 */
|
|
|
if (beHospitalizedDoc.getPastLabel() != null && beHospitalizedDoc.getPastLabel().isCrfLabel()) {
|
|
@@ -187,8 +188,14 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
if (beHospitalizedDoc.getSuppleDiagLabel() != null && beHospitalizedDoc.getSuppleDiagLabel().isCrfLabel()) {
|
|
|
putSuppleDiagCrfData(midData.getJSONObject(Content.supple_diag), inputInfo);
|
|
|
}
|
|
|
+ /* 处理专科体格检查 */
|
|
|
+ if (beHospitalizedDoc.getVitalLabelSpecial() != null && beHospitalizedDoc.getVitalLabelSpecial().isCrfLabel()) {
|
|
|
+ beHospitalizedDoc.getVitalLabelSpecial().setCrfOutput(midData.getJSONObject(Content.special_exam));
|
|
|
+ }
|
|
|
/* 处理辅助检查 */
|
|
|
if (beHospitalizedDoc.getPacsLabel() != null && beHospitalizedDoc.getPacsLabel().isCrfLabel()) {
|
|
|
+ /* 辅检提取时间、地点和提取疾病分为两个模型 */
|
|
|
+ putPacsCrfData(midData.getJSONObject(Content.pacs + "含时间地点"), inputInfo);
|
|
|
putPacsCrfData(midData.getJSONObject(Content.pacs), inputInfo);
|
|
|
}
|
|
|
}
|
|
@@ -437,7 +444,13 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
}
|
|
|
//放置入inputinfo
|
|
|
PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
|
|
|
- pacsLabel.setPacses(loadPacses(aiOut));
|
|
|
+ if (pacsLabel.getPacses() == null) {
|
|
|
+ pacsLabel.setPacses(loadPacses(aiOut));
|
|
|
+ } else {
|
|
|
+ List<Pacs> pacses = pacsLabel.getPacses();
|
|
|
+ pacses.addAll(loadPacses(aiOut));
|
|
|
+ pacsLabel.setPacses(pacses);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|