|
@@ -13,7 +13,7 @@ import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
- * @Description:术前小结
|
|
|
+ * @Description:术前小结、术前讨论
|
|
|
* @author: cy
|
|
|
* @time: 2021/2/26 14:52
|
|
|
*/
|
|
@@ -29,9 +29,16 @@ public class PreoperativeDiscussionTran extends TargetTran {
|
|
|
operationDoc.setPreoperativeDiscussionDoc(preoperativeDiscussionDoc);
|
|
|
operationDocs.add(operationDoc);
|
|
|
inputInfo.setOperationDocs(operationDocs);
|
|
|
- Map<String, String> structureMap = cutWord(text);
|
|
|
+ Map<String, String> structureMap = new HashMap<String, String>();
|
|
|
Map<String, String> retMap = new HashMap<String, String>();
|
|
|
- pDContrast(inputInfo.getOperationDocs(), structureMap);
|
|
|
+ Boolean falg = false;
|
|
|
+ if(text.split("\n")[0].contains("讨论记录")){
|
|
|
+ structureMap = cutWordRe(text);
|
|
|
+ falg = true;
|
|
|
+ }else{
|
|
|
+ structureMap = cutWord(text);
|
|
|
+ }
|
|
|
+ pDContrast(falg,inputInfo.getOperationDocs(), structureMap);
|
|
|
mapKeyContrastCommon(structureMap,stagesContrasts,retMap);
|
|
|
preoperativeDiscussionDoc.setStructureMap(retMap);
|
|
|
aiProcess();
|
|
@@ -43,13 +50,11 @@ public class PreoperativeDiscussionTran extends TargetTran {
|
|
|
Map<String, String> sourceMap = Maps.newHashMap();
|
|
|
List<String> titles = CommonAnalysisUtil.sortTitles(
|
|
|
Lists.newArrayList("简要病情","药物、食物过敏史","月经史","一般情况","入院后辅助检查","术前诊断","手术指征","手术禁忌",
|
|
|
- "拟实施手术名称","手术方式","术前准备","防范措施","手术审批医师","医师签名"),
|
|
|
+ "拟实施手术名称","手术方式","拟实施麻醉方式","术前准备","防范措施","手术审批医师","医师签名"),
|
|
|
text
|
|
|
);
|
|
|
CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
|
|
|
- if(sourceMap.containsKey("手术方式") || sourceMap.containsKey("术前诊断") || sourceMap.containsKey("月经史")
|
|
|
- || sourceMap.containsKey("一般情况")){
|
|
|
- sourceMap.remove("手术方式");
|
|
|
+ if( sourceMap.containsKey("术前诊断") || sourceMap.containsKey("月经史")|| sourceMap.containsKey("一般情况")){
|
|
|
sourceMap.remove("术前诊断");
|
|
|
sourceMap.remove("月经史");
|
|
|
sourceMap.remove("一般情况");
|
|
@@ -57,6 +62,21 @@ public class PreoperativeDiscussionTran extends TargetTran {
|
|
|
return sourceMap;
|
|
|
}
|
|
|
|
|
|
+ private Map<String, String> cutWordRe(String text) {
|
|
|
+ Map<String, String> sourceMap = Maps.newHashMap();
|
|
|
+ List<String> titleReplace = CommonAnalysisUtil.sortTitles(
|
|
|
+ Lists.newArrayList("讨论主持人","参加人员","术前诊断","讨论摘要","主持人总结"),
|
|
|
+ text
|
|
|
+ );
|
|
|
+ CommonAnalysisUtil.cutByTitles(text, titleReplace, 0, sourceMap);
|
|
|
+ if(sourceMap.containsKey("讨论主持人")|| sourceMap.containsKey("术前诊断")){
|
|
|
+ sourceMap.remove("讨论主持人");
|
|
|
+ sourceMap.remove("术前诊断");
|
|
|
+ }
|
|
|
+ return sourceMap;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
private List<String> stagesContrasts = Lists.newArrayList(
|
|
|
"手术指征=手术指征",
|
|
@@ -64,11 +84,14 @@ public class PreoperativeDiscussionTran extends TargetTran {
|
|
|
"手术禁忌=手术禁忌症",
|
|
|
"拟实施手术名称=拟实施手术及操作名称",
|
|
|
"防范措施=注意事项",
|
|
|
- "防范措施=手术要点"
|
|
|
+ "防范措施=手术要点",
|
|
|
+ "主持人总结=讨论结论",
|
|
|
+ "讨论摘要=讨论意见"
|
|
|
);
|
|
|
|
|
|
- public void pDContrast(List<OperationDoc> operationDocs,Map<String, String> retMap) {
|
|
|
+ public void pDContrast(Boolean flag,List<OperationDoc> operationDocs,Map<String, String> retMap) {
|
|
|
String text = operationDocs.get(0).getPreoperativeDiscussionDoc().getText();
|
|
|
+ if(flag == false){
|
|
|
//小结日期时间
|
|
|
String sumdDate = extractDate(text);
|
|
|
if(StringUtil.isNotEmpty(sumdDate)){
|
|
@@ -113,10 +136,19 @@ public class PreoperativeDiscussionTran extends TargetTran {
|
|
|
|
|
|
//手术指征
|
|
|
if(text.contains("手术指征:")) {
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
String opration = text.substring(text.indexOf("手术指征:") + 5);
|
|
|
- String s = opration.split("\n")[0];
|
|
|
- if(!retMap.get("手术指征").equals(s)){
|
|
|
- retMap.put("手术指征",s);
|
|
|
+ if(text.contains("拟实施手术名称")){
|
|
|
+ opration = opration.substring(0,opration.indexOf("拟实施手术名称"));
|
|
|
+ }
|
|
|
+ String[] split = opration.split("\n");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ if( split[i].contains(".")){
|
|
|
+ sb.append(split[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(sb.toString())){
|
|
|
+ retMap.put("手术指征",sb.toString());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -128,7 +160,10 @@ public class PreoperativeDiscussionTran extends TargetTran {
|
|
|
}
|
|
|
|
|
|
//手术审批医师
|
|
|
- String oprationDoc = text.substring(text.indexOf("手术审批医师:" )+ 7).trim();
|
|
|
+ String oprationDoc = "";
|
|
|
+ if(text.contains("手术审批医师:")){
|
|
|
+ oprationDoc = text.substring(text.indexOf("手术审批医师:" )+ 7).trim();
|
|
|
+ }
|
|
|
if(StringUtil.isEmpty(retMap.get("手术审批医师"))) {
|
|
|
String oprationSign = "";
|
|
|
if(oprationDoc.contains("医师签名")){
|
|
@@ -177,12 +212,82 @@ public class PreoperativeDiscussionTran extends TargetTran {
|
|
|
retMap.remove("医师签名");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- String sub = text.substring(text.lastIndexOf("手术审批医师:"));
|
|
|
- String date = extractDate(sub);
|
|
|
+ String date = "";
|
|
|
+ if(text.contains("手术审批医师:")){
|
|
|
+ String sub = text.substring(text.lastIndexOf("手术审批医师:"));
|
|
|
+ date = extractDate(sub);
|
|
|
+ }
|
|
|
if(StringUtil.isNotEmpty(date)){
|
|
|
retMap.put("签名日期时间",date);
|
|
|
}
|
|
|
+
|
|
|
+ StringBuffer sbx = new StringBuffer();
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("拟实施手术名称"))){
|
|
|
+ String plan = retMap.get("拟实施手术名称");
|
|
|
+ sbx.append("拟实施手术名称:"+plan+" ");
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("手术方式"))){
|
|
|
+ String plan = retMap.get("手术方式");
|
|
|
+ sbx.append("手术方式:"+plan+" ");
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("拟实施麻醉方式"))){
|
|
|
+ String plan = retMap.get("拟实施麻醉方式");
|
|
|
+ sbx.append("拟实施麻醉方式:"+plan+" ");
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(sbx.toString())){
|
|
|
+ retMap.put("手术方案",sbx.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// ===========================术前讨论===================================
|
|
|
+
|
|
|
+/*
|
|
|
+ if(text.contains("\n")){
|
|
|
+ String[] split = text.split("\n");
|
|
|
+ for (int i = 0; i < split.length-1; i++) {
|
|
|
+ if(i == 0 && split[i].contains("讨论记录")){
|
|
|
+ flag = true;
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+*/
|
|
|
+
|
|
|
+ //参加人员
|
|
|
+ if(flag){
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("参加人员"))){
|
|
|
+ String fir = text.substring(text.indexOf("参加人员:")+5, text.lastIndexOf("汇报病史"));
|
|
|
+ String[] split = fir.split("\n");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (int i = 0; i < split.length-1; i++) {
|
|
|
+ sb.append(split[i]).append(" ");
|
|
|
+ }
|
|
|
+ retMap.put("参加人员",sb.toString());
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("主持人总结"))){
|
|
|
+ String dirSum = retMap.get("主持人总结");
|
|
|
+ String date = extractDate(dirSum);
|
|
|
+ String signName = "";
|
|
|
+ if(dirSum.contains("记录者(签名)")){
|
|
|
+ signName = dirSum.substring(dirSum.lastIndexOf("记录者(签名)")+"记录者(签名)".length());
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotEmpty(date)) {
|
|
|
+ signName = signName.substring(0, signName.lastIndexOf(date));
|
|
|
+ retMap.put("签名日期时间",date);
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotEmpty(signName) && StringUtil.isNotEmpty(signName.trim())) {
|
|
|
+ retMap.put("医师签名",signName);
|
|
|
+ }
|
|
|
+ if(dirSum.contains("主持人(签名)")){
|
|
|
+ dirSum = dirSum.substring(0, dirSum.lastIndexOf("主持人(签名)"));
|
|
|
+ }
|
|
|
+ retMap.put("主持人总结",dirSum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ retMap.remove("手术方式");
|
|
|
+ retMap.remove("拟实施麻醉方式");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public static void mapKeyContrastCommon(Map sourceMap, List<String> keyContrasts, Map<String, String> retMap) {
|