|
@@ -6,31 +6,11 @@ import com.diagbot.client.CRFServiceClient;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessClinic;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessDiag;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessFamily;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessLis;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessMarital;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessMenses;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessPacs;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessPast;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessPersonal;
|
|
|
-import com.diagbot.model.ai.process.EntityProcessVital;
|
|
|
-import com.diagbot.model.entity.Diag;
|
|
|
-import com.diagbot.model.entity.Lis;
|
|
|
-import com.diagbot.model.entity.PD;
|
|
|
-import com.diagbot.model.entity.Pacs;
|
|
|
-import com.diagbot.model.entity.Vital;
|
|
|
-import com.diagbot.model.label.ChiefLabel;
|
|
|
-import com.diagbot.model.label.DiagLabel;
|
|
|
-import com.diagbot.model.label.FamilyLabel;
|
|
|
-import com.diagbot.model.label.MaritalLabel;
|
|
|
-import com.diagbot.model.label.MenstrualLabel;
|
|
|
-import com.diagbot.model.label.PastLabel;
|
|
|
-import com.diagbot.model.label.PersonalLabel;
|
|
|
-import com.diagbot.model.label.PresentLabel;
|
|
|
-import com.diagbot.model.label.VitalLabel;
|
|
|
+import com.diagbot.model.ai.process.*;
|
|
|
+import com.diagbot.model.entity.*;
|
|
|
+import com.diagbot.model.label.*;
|
|
|
import com.diagbot.util.Content;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.SearchData;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -40,6 +20,7 @@ import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @ClassName : InHospitalDoc
|
|
@@ -158,8 +139,18 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
wordCrfDTO.setFamilyLabel(familyLabel);
|
|
|
putContent(crfContent, medicalTextType.get(1), familyText, Content.family);
|
|
|
}
|
|
|
+ if(ListUtil.isNotEmpty(inputInfo.getPacs())){
|
|
|
+ List<PacsNew> collect = inputInfo.getPacs().stream().map(x -> {
|
|
|
+ PacsNew pacsNew = new PacsNew();
|
|
|
+ pacsNew.setName(x.getName());
|
|
|
+ pacsNew.setUniqueName(x.getUniqueName());
|
|
|
+ pacsNew.setDesc(x.getDesc());
|
|
|
+ return pacsNew;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ wordCrfDTO.setPacsNews(collect);
|
|
|
+ }
|
|
|
|
|
|
- /* *//* 辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改) *//*
|
|
|
+ /* *//* 辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改) *//*
|
|
|
if (StringUtils.isNotBlank(inputInfo.getPacsString())) {
|
|
|
String pacsText = inputInfo.getPacsString();
|
|
|
PacsLabel pacsLabel = new PacsLabel();
|
|
@@ -264,6 +255,28 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
/*if (wordCrfDTO.getPacsLabel() != null) {
|
|
|
putPacsCrfData(midData.getJSONObject(Content.pacs), wordCrfDTO);
|
|
|
}*/
|
|
|
+ /**
|
|
|
+ * 处理pacsnew
|
|
|
+ */
|
|
|
+ if(ListUtil.isNotEmpty(wordCrfDTO.getPacsNews())){
|
|
|
+ EntityProcessPacsNew entityProcessPacsNew = new EntityProcessPacsNew();
|
|
|
+ List<PacsNew> pacsNews = wordCrfDTO.getPacsNews();
|
|
|
+ for (PacsNew pacsnew:pacsNews) {
|
|
|
+ JSONArray crfPacsContent = new JSONArray();
|
|
|
+ putContent(crfPacsContent, medicalTextType.get(3), pacsnew.getDesc(), Content.pacs);
|
|
|
+ JSONObject midPacsData = loadAI(crfPacsContent, crfServiceClient);
|
|
|
+ JSONObject jsonObject = midPacsData.getJSONObject(Content.pacs);
|
|
|
+ if(jsonObject == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
+ if (aiOut == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ List<Pacs> pacs = entityProcessPacsNew.extractEntity(aiOut);
|
|
|
+ pacsnew.setPacsResults(pacs);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -487,7 +500,7 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
* @param jsonObject
|
|
|
* @param wordBillCrfDTO
|
|
|
*/
|
|
|
- /* public void putPacsCrfData(JSONObject jsonObject, WordCrfDTO wordBillCrfDTO) {
|
|
|
+ /*public void putPacsCrfData(JSONObject jsonObject, WordCrfDTO wordBillCrfDTO) {
|
|
|
if (jsonObject == null) {
|
|
|
return;
|
|
|
}
|