|
@@ -39,17 +39,26 @@ public class ConsultationTran extends TargetTran {
|
|
|
}
|
|
|
|
|
|
private List<String> stagesContrasts = Lists.newArrayList(
|
|
|
+ "病历摘要及诊疗经过=病历摘要",
|
|
|
"其病历简述如下=病历摘要",
|
|
|
+ "目前诊断=西医诊断名称",
|
|
|
+ "会诊目的及要求=会诊原因",
|
|
|
+ "会诊目的及要求=会诊目的",
|
|
|
"会诊理由=会诊原因",
|
|
|
- "会诊结论=会诊意见"
|
|
|
+ "会诊结论=会诊意见",
|
|
|
+ "申请医师签名=会诊申请医师签名",
|
|
|
+ "会诊时间=会诊日期时间"
|
|
|
);
|
|
|
private Map<String, String> cutWord(String text) {
|
|
|
Map<String, String> sourceMap = Maps.newHashMap();
|
|
|
List<String> titles = CommonAnalysisUtil.sortTitles(
|
|
|
- Lists.newArrayList("其病历简述如下","会诊理由","会诊目的","会诊理由及目的","日期","目前诊断考虑","会诊结论","会诊意见","科室"), text);
|
|
|
+ Lists.newArrayList("邀请","拟会诊日期","病历摘要及诊疗经过","申请医师签名","其病历简述如下","会诊理由","会诊目的",
|
|
|
+ "会诊理由及目的","会诊目的及要求","日期","目前诊断","其他科情况","目前诊断考虑","会诊结论","会诊意见","会诊医师签名","会诊时间","科室"), text);
|
|
|
CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
|
|
|
- if(sourceMap.containsKey("日期")){
|
|
|
+ if(sourceMap.containsKey("日期") || sourceMap.containsKey("拟会诊日期") || sourceMap.containsKey("其他科情况")){
|
|
|
sourceMap.remove("日期");
|
|
|
+ sourceMap.remove("拟会诊日期");
|
|
|
+ sourceMap.remove("其他科情况");
|
|
|
}
|
|
|
return sourceMap;
|
|
|
}
|
|
@@ -266,10 +275,84 @@ public class ConsultationTran extends TargetTran {
|
|
|
if(StringUtil.isNotEmpty("科室")){
|
|
|
retMap.remove("科室");
|
|
|
}
|
|
|
- if(StringUtil.isEmpty(retMap.get("会诊意见")) ||StringUtil.isEmpty(retMap.get("会诊结论")) ){
|
|
|
+ if(StringUtil.isEmpty(retMap.get("会诊意见"))){
|
|
|
retMap.remove("会诊意见");
|
|
|
+
|
|
|
+ }
|
|
|
+ if(StringUtil.isEmpty(retMap.get("会诊结论"))){
|
|
|
retMap.remove("会诊结论");
|
|
|
}
|
|
|
+ //===============兼容模板===================
|
|
|
+ if(text.contains("科室:") && text.contains("床号:")){
|
|
|
+ String subStr = text.substring(text.indexOf("科室:") + "科室:".length(), text.indexOf("床号:"));
|
|
|
+ if(StringUtil.isNotEmpty(subStr)) {
|
|
|
+ retMap.put("会诊科室名称",subStr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("申请医师签名"))){
|
|
|
+ String sign = retMap.get("申请医师签名");
|
|
|
+ if(sign.contains("会诊")){
|
|
|
+ sign = sign.substring(0, sign.lastIndexOf("会诊"));
|
|
|
+ if(StringUtil.isNotEmpty(sign)){
|
|
|
+ retMap.put("申请医师签名",sign);
|
|
|
+ }else{
|
|
|
+ retMap.remove("申请医师签名");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtil.isEmpty(retMap.get("会诊医师签名")) || StringUtil.isEmpty(retMap.get("会诊医师签名").trim())){
|
|
|
+ retMap.remove("会诊医师签名");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("会诊时间"))){
|
|
|
+ String date = retMap.get("会诊时间");
|
|
|
+ String dateRet = extractDate(date);
|
|
|
+ if(StringUtil.isNotEmpty(dateRet)){
|
|
|
+ retMap.put("会诊时间",dateRet);
|
|
|
+ }else{
|
|
|
+ retMap.remove("会诊时间");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("目前诊断"))){
|
|
|
+ String str = retMap.get("目前诊断");
|
|
|
+ if(str.contains("、")){
|
|
|
+ String[] split = str.split("、");
|
|
|
+ for (int i = 1; i < split.length; i++) {
|
|
|
+ String retStr = split[i].trim();
|
|
|
+ Boolean flag = false;
|
|
|
+ try {
|
|
|
+ String strInt = String.valueOf(retStr.charAt(retStr.length() - 1));
|
|
|
+ int num = Integer.parseInt(strInt);
|
|
|
+ flag = true;
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage());
|
|
|
+ }
|
|
|
+ if(!flag){
|
|
|
+ String flagRet = split[i - 1];
|
|
|
+ String sub = str.substring(str.indexOf(flagRet));
|
|
|
+ if(sub.contains("。")){
|
|
|
+ String flagFir = sub.split("。")[0];
|
|
|
+ flagFir = str.substring(0, str.indexOf(flagFir) + flagFir.length());
|
|
|
+ retMap.put("目前诊断",flagFir);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(retMap.get("邀请"))){
|
|
|
+ String interFace = retMap.get("邀请");
|
|
|
+ if(interFace.contains("医院")){
|
|
|
+ interFace = interFace.substring(0, interFace.lastIndexOf("医院")+"医院".length());
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(interFace)) {
|
|
|
+ retMap.put("会诊医师所在医疗机构名称",interFace);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ retMap.remove("邀请");
|
|
|
}
|
|
|
}
|
|
|
|