|
@@ -7,11 +7,13 @@ import com.lantone.qc.kernel.structure.ai.process.EntityProcessLeaveHospital;
|
|
|
import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
|
|
|
+import com.lantone.qc.pub.model.label.DiagLabel;
|
|
|
import com.lantone.qc.pub.model.label.LeaveHospitalLabel;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @ClassName : DischargeAI
|
|
@@ -23,7 +25,7 @@ public class LeaveHospitalAI extends ModelAI {
|
|
|
/**
|
|
|
*
|
|
|
*/
|
|
|
- public static List<String> medicalTextType = Arrays.asList("DischargeQA_cx");
|
|
|
+ public static List<String> medicalTextType = Arrays.asList("DischargeQA_cx", "Diagnoses_cx");
|
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
|
public static String outputs = "outputs";
|
|
|
public static String content = "content";
|
|
@@ -34,9 +36,18 @@ public class LeaveHospitalAI extends ModelAI {
|
|
|
if (leaveHospitalDoc != null && StringUtils.isNotEmpty(leaveHospitalDoc.getText())) {
|
|
|
//出院小结全部文本
|
|
|
putContent(crfContent, medicalTextType.get(0), leaveHospitalDoc.getText(), Content.discharge);
|
|
|
+ Map<String, String> leaveHospitalStructureMap = leaveHospitalDoc.getStructureMap();
|
|
|
+ if (leaveHospitalStructureMap != null && leaveHospitalStructureMap.get(Content.dischargeDiag) != null) {
|
|
|
+ putContent(crfContent, medicalTextType.get(1), leaveHospitalStructureMap.get(Content.dischargeDiag), Content.dischargeDiag);
|
|
|
+ }
|
|
|
|
|
|
JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
|
|
|
- putDischargeCrfData(midData.getJSONObject(Content.discharge), inputInfo);//出院小结
|
|
|
+ if (midData.containsKey(Content.discharge)) {
|
|
|
+ putDischargeCrfData(midData.getJSONObject(Content.discharge), inputInfo);//出院小结
|
|
|
+ }
|
|
|
+ if (midData.containsKey(Content.dischargeDiag)) {
|
|
|
+ putDischargeCrfData(midData.getJSONObject(Content.dischargeDiag), inputInfo);//出院诊断
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -51,6 +62,12 @@ public class LeaveHospitalAI extends ModelAI {
|
|
|
//使用现病史结构来处理病历特点
|
|
|
EntityProcessLeaveHospital entityProcessLeaveHospital = new EntityProcessLeaveHospital();
|
|
|
LeaveHospitalLabel leaveHospitalLabel = entityProcessLeaveHospital.extractEntity(aiOut);
|
|
|
+ if (inputInfo.getLeaveHospitalDoc().getLeaveDiagLabel() == null) {
|
|
|
+ DiagLabel diagLabel = new DiagLabel();
|
|
|
+ diagLabel.setDiags(leaveHospitalLabel.getDiags());
|
|
|
+ } else {
|
|
|
+ inputInfo.getLeaveHospitalDoc().getLeaveDiagLabel().setDiags(leaveHospitalLabel.getDiags());
|
|
|
+ }
|
|
|
//临床表现
|
|
|
inputInfo.getLeaveHospitalDoc().setLeaveHospitalLabel(leaveHospitalLabel);
|
|
|
}
|