|
@@ -7,9 +7,7 @@ import com.lantone.structure.facade.tran.util.CommonAnalysisUtil;
|
|
|
import com.lantone.structure.model.doc.ThreeLevelWardDoc;
|
|
|
import com.lantone.structure.model.label.ThreeLevelWardLabel;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
@@ -39,14 +37,18 @@ public class ThreeLevelWardTran extends TargetTran {
|
|
|
private Map<String, String> cutWord(String text) {
|
|
|
Map<String, String> sourceMap = Maps.newHashMap();
|
|
|
List<String> titles = CommonAnalysisUtil.sortTitles(
|
|
|
- Lists.newArrayList("鉴别诊断","诊疗计划","补充诊断","注意事项"),
|
|
|
+ Lists.newArrayList("鉴别诊断","诊疗计划","诊断考虑","补充诊断","Caprini评分为","注意事项"),
|
|
|
text
|
|
|
);
|
|
|
CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
|
|
|
- if(sourceMap.containsKey("鉴别诊断") || sourceMap.containsKey("补充诊断")|| sourceMap.containsKey("注意事项")){
|
|
|
+
|
|
|
+ if(sourceMap.containsKey("鉴别诊断") || sourceMap.containsKey("补充诊断")|| sourceMap.containsKey("注意事项")
|
|
|
+ || sourceMap.containsKey("Caprini评分为") || sourceMap.containsKey("诊断考虑")){
|
|
|
sourceMap.remove("鉴别诊断");
|
|
|
sourceMap.remove("补充诊断");
|
|
|
sourceMap.remove("注意事项");
|
|
|
+ sourceMap.remove("Caprini评分为");
|
|
|
+ sourceMap.remove("诊断考虑");
|
|
|
}
|
|
|
return sourceMap;
|
|
|
}
|
|
@@ -54,34 +56,79 @@ public class ThreeLevelWardTran extends TargetTran {
|
|
|
|
|
|
public void wardRecordContrast( List<ThreeLevelWardDoc> wardRecordDoc,Map<String, String> retMap) {
|
|
|
String text = wardRecordDoc.get(0).getText();
|
|
|
+ String fir = text;
|
|
|
//查房日期时间
|
|
|
String sumdDate = extractDate(text);
|
|
|
if(StringUtil.isNotEmpty(sumdDate)){
|
|
|
retMap.put("查房日期时间",sumdDate);
|
|
|
}
|
|
|
- if(text.contains("鉴别诊断")){
|
|
|
- String logo = text.split("\n")[1];
|
|
|
- String fir = text.substring(text.indexOf(logo) + logo.length(),text.lastIndexOf("鉴别诊断"));
|
|
|
- if(StringUtil.isNotEmpty(fir)){
|
|
|
- retMap.put("查房记录",fir);
|
|
|
+
|
|
|
+ String signName= parseString(text);
|
|
|
+ if(StringUtil.isNotEmpty(signName) && StringUtil.isNotEmpty(signName.trim()) && signName.length()<15){
|
|
|
+ retMap.put("记录人签名",signName);
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] split = text.split("\n");
|
|
|
+ String logo = split[1];
|
|
|
+ fir = text.substring(text.indexOf(logo) + logo.length());
|
|
|
+ if( StringUtil.isNotEmpty(signName.trim()) && signName.length()<15){
|
|
|
+ fir = text.substring(text.indexOf(logo) + logo.length(),text.lastIndexOf(signName));
|
|
|
+ String flag = "/";
|
|
|
+ if(fir.endsWith("//")){
|
|
|
+ flag = "//";
|
|
|
}
|
|
|
+ fir = fir.substring(0,fir.lastIndexOf(flag));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtil.isNotEmpty(fir)){
|
|
|
+ retMap.put("查房记录",fir);
|
|
|
}
|
|
|
|
|
|
if(StringUtil.isNotEmpty(retMap.get("诊疗计划"))){
|
|
|
String plan = retMap.get("诊疗计划");
|
|
|
- String Data = parseString(plan);
|
|
|
- retMap.put("诊疗计划",Data);
|
|
|
+ if(StringUtil.isNotEmpty( retMap.get("记录人签名")) && StringUtil.isNotEmpty( retMap.get("记录人签名").trim())){
|
|
|
+ String name = retMap.get("记录人签名").trim();
|
|
|
+ plan = plan.substring(0,plan.lastIndexOf(name));
|
|
|
+ }
|
|
|
+ if(plan.contains("诊断考虑:")){
|
|
|
+ plan = plan.substring(0,plan.lastIndexOf("诊断考虑:"));
|
|
|
+ }
|
|
|
+ if(plan.contains("VTE风险评估")){
|
|
|
+ plan = plan.substring(0,plan.lastIndexOf("。")+"。".length());
|
|
|
+ }
|
|
|
+ String flag = "/";
|
|
|
+ if(fir.endsWith("//")){
|
|
|
+ flag = "//";
|
|
|
+ }
|
|
|
+ if(plan.endsWith(flag)){
|
|
|
+ plan = plan.substring(0,plan.lastIndexOf(flag));
|
|
|
+ }
|
|
|
+ if(plan.endsWith(",")){
|
|
|
+ plan = plan.substring(0,plan.lastIndexOf(","));
|
|
|
+ }
|
|
|
+ retMap.put("诊疗计划",plan);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 取/后
|
|
|
public static String parseString(String text){
|
|
|
if(text.contains("/")){
|
|
|
- text = text.substring(0,text.lastIndexOf("/"));
|
|
|
+ text = text.substring(text.lastIndexOf("/")+1);
|
|
|
text= parseString(text);
|
|
|
}
|
|
|
return text;
|
|
|
}
|
|
|
|
|
|
+ // 取/前
|
|
|
+ public static String parseStr(String text){
|
|
|
+ if(text.contains("/")){
|
|
|
+ text = text.substring(0,text.lastIndexOf("/"));
|
|
|
+ text= parseStr(text);
|
|
|
+ }
|
|
|
+ return text;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 抽取文本中的第一个时间
|
|
|
*
|