|
@@ -18,6 +18,7 @@ import com.lantone.structure.model.entity.Drug;
|
|
import com.lantone.structure.model.label.OperationDiscussionLabel;
|
|
import com.lantone.structure.model.label.OperationDiscussionLabel;
|
|
import com.lantone.structure.model.label.OperationRecordLabel;
|
|
import com.lantone.structure.model.label.OperationRecordLabel;
|
|
import com.lantone.common.util.StringUtil;
|
|
import com.lantone.common.util.StringUtil;
|
|
|
|
+import com.lantone.structure.model.label.PreoperativeDiscussionLabel;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
@@ -34,7 +35,7 @@ public class OperationAI extends ModelAI {
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
- public static List<String> medicalTextType = Arrays.asList("CourseAfterOperation_cx", "CourseRecordSRR","Taizhou_preoperativeDiscussion_record");
|
|
|
|
|
|
+ public static List<String> medicalTextType = Arrays.asList("CourseAfterOperation_cx", "CourseRecordSRR","Taizhou_pDiscussion_record");
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
public static String outputs = "outputs";
|
|
public static String outputs = "outputs";
|
|
public static String content = "content";
|
|
public static String content = "content";
|
|
@@ -51,10 +52,7 @@ public class OperationAI extends ModelAI {
|
|
String text = preoperativeDiscussionDoc.getText();
|
|
String text = preoperativeDiscussionDoc.getText();
|
|
String opName = structureMap.get("拟实施手术及操作名称");
|
|
String opName = structureMap.get("拟实施手术及操作名称");
|
|
StringBuffer sb = new StringBuffer();
|
|
StringBuffer sb = new StringBuffer();
|
|
- if(StringUtil.isNotEmpty(opName)){
|
|
|
|
- sb.append("拟实施手术名称:"+opName+"\n");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ putContent(crfContent, medicalTextType.get(2),opName,Content.opName);
|
|
String opFlag = structureMap.get("手术指征");
|
|
String opFlag = structureMap.get("手术指征");
|
|
if(StringUtil.isNotEmpty(opFlag)){
|
|
if(StringUtil.isNotEmpty(opFlag)){
|
|
sb.append("手术指征:"+opFlag+"\n");
|
|
sb.append("手术指征:"+opFlag+"\n");
|
|
@@ -65,10 +63,15 @@ public class OperationAI extends ModelAI {
|
|
sb.append("简要病情:"+simCase+"\n");
|
|
sb.append("简要病情:"+simCase+"\n");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String pillCase = structureMap.get("药物、食物过敏史");
|
|
|
|
+ if(StringUtil.isNotEmpty(pillCase) && StringUtil.isEmpty(simCase)){
|
|
|
|
+ sb.append("药物、食物过敏史:"+pillCase+"\n");
|
|
|
|
+ }
|
|
|
|
+
|
|
if(StringUtil.isNotEmpty(sb.toString())){
|
|
if(StringUtil.isNotEmpty(sb.toString())){
|
|
text = sb.toString();
|
|
text = sb.toString();
|
|
}
|
|
}
|
|
- putContent(crfContent, medicalTextType.get(2),text, content, Content.preoperativeDiscussion);
|
|
|
|
|
|
+ putContent(crfContent, medicalTextType.get(2),text,Content.preoperativeDiscussion);
|
|
}
|
|
}
|
|
if (operationDocs.get(i).getOperationRecordDoc() != null) {
|
|
if (operationDocs.get(i).getOperationRecordDoc() != null) {
|
|
OperationRecordDoc operationRecordDoc = operationDocs.get(i).getOperationRecordDoc();
|
|
OperationRecordDoc operationRecordDoc = operationDocs.get(i).getOperationRecordDoc();
|
|
@@ -90,13 +93,13 @@ public class OperationAI extends ModelAI {
|
|
|
|
|
|
JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
|
|
JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
|
|
|
|
|
|
-/* for (int i = 0; i < operationDocs.size(); i++) {
|
|
|
|
|
|
+ for (int i = 0; i < operationDocs.size(); i++) {
|
|
if (midData.get(Content.preoperativeDiscussion) == null) {
|
|
if (midData.get(Content.preoperativeDiscussion) == null) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- PreoperativeDiscussionDoc preoperativeDiscussionDoc = putPreoperativeDiscussionCrfData(midData.getJSONObject(Content.preoperativeDiscussion));
|
|
|
|
- operationDocs.get(i).setPreoperativeDiscussionDoc(preoperativeDiscussionDoc);
|
|
|
|
- }*/
|
|
|
|
|
|
+ putPreoperativeDiscussionCrfData(midData.getJSONObject(Content.preoperativeDiscussion),inputInfo);
|
|
|
|
+ putPreoperativeDiscussionCrfData(midData.getJSONObject(Content.opName),inputInfo);
|
|
|
|
+ }
|
|
|
|
|
|
for (int i = 0; i < operationDocs.size(); i++) {
|
|
for (int i = 0; i < operationDocs.size(); i++) {
|
|
if (midData.get("手术记录" + i + "药物") != null) {
|
|
if (midData.get("手术记录" + i + "药物") != null) {
|
|
@@ -140,7 +143,6 @@ public class OperationAI extends ModelAI {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 存放抓取的药品
|
|
* 存放抓取的药品
|
|
- *
|
|
|
|
* @param jsonObject
|
|
* @param jsonObject
|
|
*/
|
|
*/
|
|
public List<Drug> putDrugCrfData(JSONObject jsonObject) {
|
|
public List<Drug> putDrugCrfData(JSONObject jsonObject) {
|
|
@@ -158,18 +160,17 @@ public class OperationAI extends ModelAI {
|
|
*
|
|
*
|
|
* @param jsonObject
|
|
* @param jsonObject
|
|
*/
|
|
*/
|
|
- public PreoperativeDiscussionDoc putPreoperativeDiscussionCrfData(JSONObject jsonObject) {
|
|
|
|
- PreoperativeDiscussionDoc preoperativeDiscussionDoc = new PreoperativeDiscussionDoc();
|
|
|
|
|
|
+ public void putPreoperativeDiscussionCrfData(JSONObject jsonObject,InputInfo inputInfo) {
|
|
if (jsonObject == null) {
|
|
if (jsonObject == null) {
|
|
- return preoperativeDiscussionDoc;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
if (aiOut == null) {
|
|
if (aiOut == null) {
|
|
- return preoperativeDiscussionDoc;
|
|
|
|
|
|
+ return ;
|
|
}
|
|
}
|
|
EntityProcessOperation entityProcessOperation = new EntityProcessOperation();
|
|
EntityProcessOperation entityProcessOperation = new EntityProcessOperation();
|
|
- PreoperativeDiscussionDoc preoperativeDiscussionDoc1 = entityProcessOperation.extractEntity(aiOut);
|
|
|
|
- return preoperativeDiscussionDoc1;
|
|
|
|
|
|
+ PreoperativeDiscussionLabel preoperativeDiscussionLabel = entityProcessOperation.extractEntity(aiOut);
|
|
|
|
+ inputInfo.getOperationDocs().get(0).getPreoperativeDiscussionDoc().setPreoperativeDiscussionLabel(preoperativeDiscussionLabel);
|
|
}
|
|
}
|
|
|
|
|
|
protected void putContent(JSONArray crfContent, String medicalTextType, String text, String sign) {
|
|
protected void putContent(JSONArray crfContent, String medicalTextType, String text, String sign) {
|