|
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -153,15 +154,19 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
wordCrfDTO.setPacsLabel(pacsLabel);
|
|
|
}
|
|
|
|
|
|
- /* *//* 辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改) *//*
|
|
|
- if (StringUtils.isNotBlank(inputInfo.getPacsString())) {
|
|
|
- String pacsText = inputInfo.getPacsString();
|
|
|
+ //* 辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改) *//*
|
|
|
+ if (ListUtil.isNotEmpty(wordCrfDTO.getPacs())) {
|
|
|
+
|
|
|
+ String pacsText = "";
|
|
|
+ List<String> collect = wordCrfDTO.getPacs().stream().map(x -> (StringUtils.isEmpty(x.getUniqueName()) ? x.getName() : x.getUniqueName()) + ":" + x.getResult()).collect(Collectors.toList());
|
|
|
+ pacsText = String.join("\n",collect);
|
|
|
PacsLabel pacsLabel = new PacsLabel();
|
|
|
pacsLabel.setText(pacsText);
|
|
|
pacsLabel.setAiText(pacsText);
|
|
|
wordCrfDTO.setPacsLabel(pacsLabel);
|
|
|
- putContent(crfContent, medicalTextType.get(3), pacsText, Content.pacs);
|
|
|
+ putContent(crfContent, medicalTextType.get(5), pacsText, Content.pacs);
|
|
|
}
|
|
|
+ /*
|
|
|
//* 专科检查(专科体格检查)
|
|
|
if (beHospitalizedDoc.getVitalLabelSpecial() != null && beHospitalizedDoc.getVitalLabelSpecial().isCrfLabel()) {
|
|
|
String vitalSpecialText = beHospitalizedDoc.getVitalLabelSpecial().getText();
|
|
@@ -255,13 +260,16 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
putSuppleDiagCrfData(midData.getJSONObject(Content.supple_diag), inputInfo);
|
|
|
}*/
|
|
|
/* 处理辅助检查 */
|
|
|
- /*if (wordCrfDTO.getPacsLabel() != null) {
|
|
|
- putPacsCrfData(midData.getJSONObject(Content.pacs), wordCrfDTO);
|
|
|
- }*/
|
|
|
+ if (wordCrfDTO.getPacsLabel() != null) {
|
|
|
+ Map<String, String> name_uniqueName = wordCrfDTO.getPacs().stream().filter(x -> StringUtils.isNotBlank(x.getUniqueName()))
|
|
|
+ .collect(Collectors.toMap(com.diagbot.biz.push.entity.Pacs::getName, com.diagbot.biz.push.entity.Pacs::getUniqueName
|
|
|
+ , (k1, k2) -> k2));
|
|
|
+ putPacsCrfData(midData.getJSONObject(Content.pacs), wordCrfDTO, name_uniqueName);
|
|
|
+ }
|
|
|
/**
|
|
|
* 处理辅检pacsnew
|
|
|
*/
|
|
|
- if(wordCrfDTO.getPacsLabel() != null && ListUtil.isNotEmpty(wordCrfDTO.getPacsLabel().getPacsNewList())){
|
|
|
+ /*if(wordCrfDTO.getPacsLabel() != null && ListUtil.isNotEmpty(wordCrfDTO.getPacsLabel().getPacsNewList())){
|
|
|
EntityProcessPacsNew entityProcessPacsNew = new EntityProcessPacsNew();
|
|
|
List<PacsNew> pacsNews = wordCrfDTO.getPacsLabel().getPacsNewList();
|
|
|
for (PacsNew pacsnew:pacsNews) {
|
|
@@ -278,7 +286,7 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
}
|
|
|
entityProcessPacsNew.extractEntity(aiOut, pacsnew);
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -502,7 +510,7 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
* @param jsonObject
|
|
|
* @param wordBillCrfDTO
|
|
|
*/
|
|
|
- /*public void putPacsCrfData(JSONObject jsonObject, WordCrfDTO wordBillCrfDTO) {
|
|
|
+ public void putPacsCrfData(JSONObject jsonObject, WordCrfDTO wordBillCrfDTO,Map<String, String> name_uniqueName) {
|
|
|
if (jsonObject == null) {
|
|
|
return;
|
|
|
}
|
|
@@ -512,8 +520,8 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
}
|
|
|
//放置入inputinfo
|
|
|
PacsLabel pacsLabel = wordBillCrfDTO.getPacsLabel();
|
|
|
- pacsLabel.setPacses(loadPacses(aiOut));
|
|
|
- }*/
|
|
|
+ pacsLabel.setPacses(loadPacses(aiOut,name_uniqueName));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 关系抽取疾病信息
|
|
@@ -547,10 +555,11 @@ public class BeHospitalizedAI extends ModelAI {
|
|
|
* @param aiOut
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Pacs> loadPacses(JSONObject aiOut) {
|
|
|
+ public List<Pacs> loadPacses(JSONObject aiOut,Map<String, String> name_uniqueName) {
|
|
|
//辅检信息
|
|
|
EntityProcessPacs entityProcessLis = new EntityProcessPacs();
|
|
|
- List<Pacs> pacses = entityProcessLis.extractEntity(aiOut);
|
|
|
+ List<Pacs> pacses = entityProcessLis.extractEntity(aiOut,name_uniqueName);
|
|
|
+ pacses = pacses.stream().filter(x ->StringUtils.isNotBlank(x.getName())).collect(Collectors.toList());
|
|
|
return pacses;
|
|
|
}
|
|
|
|