|
@@ -3,21 +3,18 @@ package com.lantone.structure.ai;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.lantone.common.util.ListUtil;
|
|
|
+import com.lantone.structure.ai.process.*;
|
|
|
import com.lantone.structure.client.CRFServiceClient;
|
|
|
import com.lantone.structure.client.SimilarityServiceClient;
|
|
|
-import com.lantone.structure.ai.process.EntityProcessClinic;
|
|
|
-import com.lantone.structure.ai.process.EntityProcessDiag;
|
|
|
-import com.lantone.structure.ai.process.EntityProcessDrug;
|
|
|
-import com.lantone.structure.ai.process.EntityProcessTreatPlan;
|
|
|
import com.lantone.common.util.CatalogueUtil;
|
|
|
import com.lantone.structure.model.Content;
|
|
|
import com.lantone.structure.model.InputInfo;
|
|
|
+import com.lantone.structure.model.doc.DailyCourseRecordDoc;
|
|
|
import com.lantone.structure.model.doc.FirstCourseRecordDoc;
|
|
|
import com.lantone.structure.model.entity.Diag;
|
|
|
import com.lantone.structure.model.entity.Drug;
|
|
|
-import com.lantone.structure.model.label.DrugLabel;
|
|
|
-import com.lantone.structure.model.label.PresentLabel;
|
|
|
-import com.lantone.structure.model.label.TreatPlanLabel;
|
|
|
+import com.lantone.structure.model.label.*;
|
|
|
import com.lantone.common.util.StringUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
@@ -36,7 +33,7 @@ public class FirstCourseRecordAI extends ModelAI {
|
|
|
*
|
|
|
*/
|
|
|
public static List<String> medicalTextType = Arrays.asList("FirstCoursera_cx", "Diagnoses_cx"
|
|
|
- , "FirstCourseTreatment_cx", "CourseRecordSRR");
|
|
|
+ , "FirstCourseTreatment_cx", "CourseRecordSRR","Taizhou_before_surgery");
|
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
|
public static String outputs = "outputs";
|
|
|
public static String content = "content";
|
|
@@ -44,6 +41,20 @@ public class FirstCourseRecordAI extends ModelAI {
|
|
|
public void medrec(InputInfo inputInfo, CRFServiceClient crfServiceClient, SimilarityServiceClient similarityServiceClient) {
|
|
|
JSONArray crfContent = new JSONArray();
|
|
|
JSONArray similarContent = new JSONArray();
|
|
|
+ List<DailyCourseRecordDoc> dailyCourseRecordDocs = inputInfo.getDailyCourseRecordDocs();
|
|
|
+ if (ListUtil.isNotEmpty(dailyCourseRecordDocs)) {
|
|
|
+ DailyCourseRecordDoc dailyCourseRecordDoc = dailyCourseRecordDocs.get(0);
|
|
|
+ if (dailyCourseRecordDoc != null) {
|
|
|
+ String text = dailyCourseRecordDoc.getText();
|
|
|
+ if(text.contains("医嘱")){
|
|
|
+ //title记得改!!!!Taizhou_before_surgery
|
|
|
+ text = text.substring(text.indexOf("医嘱"),text.lastIndexOf(""));
|
|
|
+ putContent(crfContent, medicalTextType.get(4), text, Content.doctorAdviceRecord);
|
|
|
+ JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
|
|
|
+ dailyCourseRecordCrfData(midData.getJSONObject(Content.doctorAdviceRecord), inputInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
|
|
|
if (firstCourseRecordDoc != null) {
|
|
|
Map<String, String> structureMap = firstCourseRecordDoc.getStructureMap();
|
|
@@ -187,6 +198,24 @@ public class FirstCourseRecordAI extends ModelAI {
|
|
|
inputInfo.getFirstCourseRecordDoc().getInitialDiagLabel().setDiags(diags);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 处理日常病程记录
|
|
|
+ *
|
|
|
+ * @param jsonObject
|
|
|
+ */
|
|
|
+ public void dailyCourseRecordCrfData(JSONObject jsonObject, InputInfo inputInfo) {
|
|
|
+ if (jsonObject == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
+ if (aiOut == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ EntityDailyCourseRecord entityDailyCourseRecord = new EntityDailyCourseRecord();
|
|
|
+ DailyCourseRecordLabel dailyCourseRecordLabel = entityDailyCourseRecord.extractEntity(aiOut);
|
|
|
+ inputInfo.getDailyCourseRecordDocs().get(0).setDailyCourseRecordLabel(dailyCourseRecordLabel);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 诊断依据
|
|
|
*
|