|
@@ -36,26 +36,30 @@ public class DeathRecordTran extends TargetTran {
|
|
private List<String> stagesContrasts = Lists.newArrayList(
|
|
private List<String> stagesContrasts = Lists.newArrayList(
|
|
"姓名=患者姓名",
|
|
"姓名=患者姓名",
|
|
"入院日期=入院日期时间",
|
|
"入院日期=入院日期时间",
|
|
|
|
+ "入院时间=入院日期时间",
|
|
"诊疗经过=诊疗过程描述",
|
|
"诊疗经过=诊疗过程描述",
|
|
"死亡日期=死亡日期时间",
|
|
"死亡日期=死亡日期时间",
|
|
|
|
+ "死亡时间=死亡日期时间",
|
|
"死亡诊断=死亡诊断名称"
|
|
"死亡诊断=死亡诊断名称"
|
|
);
|
|
);
|
|
private Map<String, String> cutWord(String text) {
|
|
private Map<String, String> cutWord(String text) {
|
|
Map<String, String> sourceMap = Maps.newHashMap();
|
|
Map<String, String> sourceMap = Maps.newHashMap();
|
|
List<String> titles = CommonAnalysisUtil.sortTitles(
|
|
List<String> titles = CommonAnalysisUtil.sortTitles(
|
|
//
|
|
//
|
|
- Lists.newArrayList("姓名","性别","年龄","职业","入院日期","入院诊断", "死亡日期",
|
|
|
|
- "住院天数","死亡诊断","最后诊断","入院情况","诊疗经过", "治疗经过","抢救措施","死亡原因(包括死亡讨论结果)"),
|
|
|
|
|
|
+ Lists.newArrayList("姓名","性别","年龄","职业","入院日期","入院时间","入院诊断", "死亡日期","死亡时间","主 诉",
|
|
|
|
+ "住院天数","死亡诊断","最后诊断","入院情况","流行病史","表格<诊断>内容","诊疗经过", "治疗经过","抢救措施","死亡原因","死亡原因(包括死亡讨论结果)"),
|
|
text
|
|
text
|
|
);
|
|
);
|
|
|
|
|
|
CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
|
|
CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
|
|
if(sourceMap.containsKey("性别")||sourceMap.containsKey("职业")||sourceMap.containsKey("住院天数")
|
|
if(sourceMap.containsKey("性别")||sourceMap.containsKey("职业")||sourceMap.containsKey("住院天数")
|
|
- ||sourceMap.containsKey("入院诊断") ){
|
|
|
|
|
|
+ ||sourceMap.containsKey("入院诊断") ||sourceMap.containsKey("流行病史") ||sourceMap.containsKey("补充诊断")){
|
|
sourceMap.remove("性别");
|
|
sourceMap.remove("性别");
|
|
sourceMap.remove("职业");
|
|
sourceMap.remove("职业");
|
|
sourceMap.remove("住院天数");
|
|
sourceMap.remove("住院天数");
|
|
sourceMap.remove("入院诊断");
|
|
sourceMap.remove("入院诊断");
|
|
|
|
+ sourceMap.remove("流行病史");
|
|
|
|
+ sourceMap.remove("补充诊断");
|
|
}
|
|
}
|
|
return sourceMap;
|
|
return sourceMap;
|
|
}
|
|
}
|
|
@@ -132,6 +136,28 @@ public class DeathRecordTran extends TargetTran {
|
|
//直接死亡原因名称
|
|
//直接死亡原因名称
|
|
if (StringUtil.isNotEmpty(retMap.get("死亡诊断"))) {
|
|
if (StringUtil.isNotEmpty(retMap.get("死亡诊断"))) {
|
|
String deathDiagnosislName = retMap.get("死亡诊断");
|
|
String deathDiagnosislName = retMap.get("死亡诊断");
|
|
|
|
+ Boolean flag = false;
|
|
|
|
+ if(deathDiagnosislName.contains("/")){
|
|
|
|
+ deathDiagnosislName = deathDiagnosislName.substring(0, deathDiagnosislName.lastIndexOf("/"));
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+ if(deathDiagnosislName.contains("管理员")){
|
|
|
|
+ deathDiagnosislName = deathDiagnosislName.substring(0, deathDiagnosislName.lastIndexOf("管理员"));
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+ if(deathDiagnosislName.contains(" ")){
|
|
|
|
+ String[] split = deathDiagnosislName.split(" ");
|
|
|
|
+ if(split.length>2){
|
|
|
|
+ deathDiagnosislName = split[0];
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(flag && StringUtil.isNotEmpty(deathDiagnosislName)){
|
|
|
|
+ retMap.put("死亡诊断",deathDiagnosislName);
|
|
|
|
+ retMap.put("死亡诊断-西医诊断名称",deathDiagnosislName);
|
|
|
|
+ }else{
|
|
|
|
+ retMap.remove("死亡诊断");
|
|
|
|
+ }
|
|
comatible(deathDiagnosislName,retMap);
|
|
comatible(deathDiagnosislName,retMap);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -170,6 +196,110 @@ public class DeathRecordTran extends TargetTran {
|
|
}
|
|
}
|
|
retMap.remove("死亡原因(包括死亡讨论结果)");
|
|
retMap.remove("死亡原因(包括死亡讨论结果)");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //兼容日间
|
|
|
|
+ //主诉
|
|
|
|
+ if (StringUtil.isEmpty(retMap.get("主诉"))) {
|
|
|
|
+ retMap.remove("主诉");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //入院情况
|
|
|
|
+ if (StringUtil.isEmpty(retMap.get("入院情况"))) {
|
|
|
|
+ retMap.remove("入院情况");
|
|
|
|
+ }else{
|
|
|
|
+ String firStr = retMap.get("入院情况");
|
|
|
|
+ if(firStr.contains("初步诊断:")){
|
|
|
|
+ String str = firStr.substring(0, firStr.lastIndexOf("初步诊断:"));
|
|
|
|
+ if(StringUtil.isNotEmpty(str)){
|
|
|
|
+ retMap.put("入院情况",str);
|
|
|
|
+ }else{
|
|
|
|
+ retMap.remove("入院情况");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //死亡时间
|
|
|
|
+ if (StringUtil.isEmpty(retMap.get("死亡时间"))) {
|
|
|
|
+ retMap.remove("死亡时间");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //死亡原因
|
|
|
|
+ if (StringUtil.isEmpty(retMap.get("死亡原因"))) {
|
|
|
|
+ retMap.remove("死亡原因");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //初步诊断
|
|
|
|
+ if (StringUtil.isNotEmpty(retMap.get("表格<诊断>内容"))) {
|
|
|
|
+ String firStr = retMap.get("表格<诊断>内容");
|
|
|
|
+ String retStr = "";
|
|
|
|
+ if(firStr.contains("初步诊断:")){
|
|
|
|
+
|
|
|
|
+ retStr = firStr.substring(firStr.lastIndexOf("初步诊断:")+"初步诊断:".length());
|
|
|
|
+ }
|
|
|
|
+ if(retStr.contains("补充诊断:")){
|
|
|
|
+ retStr = retStr.split("补充诊断:")[0];
|
|
|
|
+ }
|
|
|
|
+ if(StringUtil.isNotEmpty(retStr.trim()) && retStr.contains("医师签名")){
|
|
|
|
+ retStr= retStr.substring(0,retStr.lastIndexOf("医师签名"));
|
|
|
|
+ }else{
|
|
|
|
+ if( !retStr.contains("日 期") && retStr.contains("年") && retStr.contains("月")){
|
|
|
|
+ String date = lastTime(retStr);
|
|
|
|
+ if(StringUtil.isNotEmpty(date)) {
|
|
|
|
+ retStr= retStr.substring(retStr.lastIndexOf("初步诊断:")+"初步诊断:".length(),retStr.lastIndexOf(date));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtil.isNotEmpty(retStr.trim())) {
|
|
|
|
+ retMap.put("入院诊断-西医诊断名称",retStr);
|
|
|
|
+ }
|
|
|
|
+ retMap.remove("表格<诊断>内容");
|
|
|
|
+ }else{
|
|
|
|
+ retMap.remove("表格<诊断>内容");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //入院时间
|
|
|
|
+ if (StringUtil.isEmpty(retMap.get("入院时间"))) {
|
|
|
|
+ retMap.remove("入院时间");
|
|
|
|
+ }
|
|
|
|
+ String text = deathRecordDoc.getText();
|
|
|
|
+ String[] split = text.split("\n");
|
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
|
+ if( split[i].contains("姓 名:")){
|
|
|
|
+ String nameStr = split[i].substring(split[i].indexOf("姓 名:")+"姓 名:".length());
|
|
|
|
+ if (StringUtil.isNotEmpty(nameStr) && StringUtil.isEmpty(retMap.get("姓名"))) {
|
|
|
|
+ retMap.put("姓名",nameStr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if( split[i].contains("性 别:")){
|
|
|
|
+ String nameStr = split[i].substring(split[i].indexOf("性 别:")+"性 别:".length());
|
|
|
|
+ if (StringUtil.isNotEmpty(nameStr) && StringUtil.isEmpty(retMap.get("性别"))) {
|
|
|
|
+ retMap.put("性别",nameStr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if( split[i].contains("年 龄:")){
|
|
|
|
+ String nameStr = split[i].substring(split[i].indexOf("年 龄:")+"年 龄:".length());
|
|
|
|
+ if (StringUtil.isNotEmpty(nameStr) && StringUtil.isEmpty(retMap.get("年龄(岁)"))|| StringUtil.isEmpty(retMap.get("年龄(月)"))) {
|
|
|
|
+ if (nameStr.contains("岁")) {
|
|
|
|
+ retMap.put("年龄(岁)", nameStr);
|
|
|
|
+ retMap.remove("年龄");
|
|
|
|
+ }
|
|
|
|
+ if (nameStr.contains("月")) {
|
|
|
|
+ retMap.put("年龄(月)", nameStr);
|
|
|
|
+ retMap.remove("年龄");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if( split[i].contains("职 业:")){
|
|
|
|
+ String nameStr = split[i].substring(split[i].indexOf("职 业:")+"职 业:".length());
|
|
|
|
+ if (StringUtil.isNotEmpty(nameStr) && StringUtil.isEmpty(retMap.get("职业"))) {
|
|
|
|
+ retMap.put("职业",nameStr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -187,7 +317,6 @@ public class DeathRecordTran extends TargetTran {
|
|
trueRet= deathDiagnosislName.trim().split(" ")[0];
|
|
trueRet= deathDiagnosislName.trim().split(" ")[0];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
if(StringUtil.isNotEmpty(trueRet)){
|
|
if(StringUtil.isNotEmpty(trueRet)){
|
|
retMap.put("直接死亡原因名称", trueRet);
|
|
retMap.put("直接死亡原因名称", trueRet);
|
|
}
|
|
}
|