|
@@ -2,6 +2,7 @@ package com.lantone.qc.trans.ninghaifuyao.util;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -10,6 +11,8 @@ import org.jsoup.nodes.Element;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
* @Description:
|
|
@@ -85,14 +88,17 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
endTime = endTime.split("手术名称")[0].trim();
|
|
|
}
|
|
|
map.put("手术结束时间", endTime);
|
|
|
- map.put("手术日期","开始:"+map.get("手术开始时间")+" 结束:"+map.get("手术结束时间"));
|
|
|
+ map.put("手术日期",map.get("手术开始时间"));
|
|
|
|
|
|
}
|
|
|
|
|
|
if(map.containsKey("手术开始时间") && map.containsKey("手术结束时间")){
|
|
|
- map.put("手术日期","开始:"+map.get("手术开始时间")+" 结束:"+map.get("手术结束时间"));
|
|
|
+ map.put("手术日期",map.get("手术开始时间"));
|
|
|
}
|
|
|
|
|
|
+ //这些科室的手术时间写了好几种格式分别处理
|
|
|
+// List<String> departmentList = Lists.newArrayList("妇科","十六病区VIP");
|
|
|
+ getOperaTime(map,null);
|
|
|
CommonAnalysisUtil.makeEmpty(map, "医生签名");
|
|
|
NingHaiFuYaoHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
|
|
|
} catch (Exception e) {
|
|
@@ -101,6 +107,75 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ private void getOperaTime(Map<String, String> map,List<String> departmentList) {
|
|
|
+// if(map.containsKey("病区")&&departmentList.contains(map.get("病区")))
|
|
|
+ if(map.containsKey("病区"))
|
|
|
+ {
|
|
|
+ //手术日期: 2021-01-06 手术时间: 上午
|
|
|
+ if(map.containsKey("手术日期")&&map.containsKey("手术时间"))
|
|
|
+ {
|
|
|
+ if(map.get("手术时间").contains(":")|map.get("手术时间").contains(": ")
|
|
|
+ |map.get("手术时间").contains(": "))
|
|
|
+ {
|
|
|
+ map.put("手术时间",map.get("手术时间").replaceAll(":",":")
|
|
|
+ .replaceAll(": ",":")
|
|
|
+ .replaceAll(": ",":"));
|
|
|
+ }
|
|
|
+ Pattern p = Pattern.compile("[0-9]+:[0-9][0-9]|[0-9][0-9]+:[0-9][0-9]");
|
|
|
+ Matcher m = p.matcher(map.get("手术时间"));
|
|
|
+
|
|
|
+ String pattern = "(上午|下午|晚上|凌晨|中午|晚)";
|
|
|
+ if(StringUtil.isNotBlank(map.get("手术时间"))&& Pattern.matches(pattern, map.get("手术时间"))){
|
|
|
+ map.put("手术时间",map.get("手术日期"));
|
|
|
+ }
|
|
|
+ //如果手术时间为时刻没有具体某天例:(手术日期: 2021年01月05日 手术时间: 12:10)
|
|
|
+ else if(m.find())
|
|
|
+ {
|
|
|
+ map.put("手术时间",map.get("手术日期")+m.group(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //手术时间:2021-01-05 10:12-10:40 或 开始时间-结束时间 排除没有日期的手术时间10:12-10:40
|
|
|
+ String operationStartDateStr = map.get("手术时间");
|
|
|
+ if(StringUtil.isNotBlank(operationStartDateStr)&&operationStartDateStr.contains("-")&&
|
|
|
+ operationStartDateStr.length()>11)
|
|
|
+ {
|
|
|
+ //手术时间 -> 2021.01.1210:55--12:15
|
|
|
+ if(operationStartDateStr.contains("--"))
|
|
|
+ {
|
|
|
+ operationStartDateStr = operationStartDateStr.substring(0,operationStartDateStr.lastIndexOf("--")).trim();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ operationStartDateStr = operationStartDateStr.substring(0,operationStartDateStr.lastIndexOf("-")).trim();
|
|
|
+ }
|
|
|
+ if(StringUtil.parseDateTime(operationStartDateStr, Content.dateFormats)!=null)
|
|
|
+ {
|
|
|
+ map.put("手术时间",operationStartDateStr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //手术日期 -> 2021年01月15日15时25分- 2021年01月15日16时05分 无手术时间
|
|
|
+ if(map.containsKey("手术日期"))
|
|
|
+ {
|
|
|
+ Pattern p = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日[0-9]+时[0-9]+分");
|
|
|
+ Matcher m = p.matcher(map.get("手术日期"));
|
|
|
+ if (m.find()) {
|
|
|
+ map.put("手术日期",m.group(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //手术时间:2021-01-06 上午
|
|
|
+ if(map.containsKey("手术时间"))
|
|
|
+ {
|
|
|
+ map.put("手术时间",map.get("手术时间")
|
|
|
+ .replaceAll("上午","")
|
|
|
+ .replaceAll("下午","")
|
|
|
+ .replaceAll("中午","")
|
|
|
+ .replaceAll("晚上","")
|
|
|
+ .replaceAll("晚","")
|
|
|
+ .replaceAll("凌晨","").trim());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void analysisGeneral(Element bigDivElement, Map<String, String> map) {
|
|
|
/*if (bigDivElement.selectFirst("hr") != null) {
|
|
|
bigDivElement.selectFirst("hr").previousElementSiblings().remove();
|
|
@@ -109,12 +184,12 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
text = text.replaceAll("第1页", "");
|
|
|
List<String> titles = Lists.newArrayList(
|
|
|
"姓名", "性别", "出生日期", "出生年月", "科别", "科室", "病区", "床号", "床位", "住院号","手术开始时间","手术结束时间",
|
|
|
- "手术时间", "手术日期", "术前诊断", "手术指征", "手术人员", "外邀指导专家","麻醉方式", "麻醉人员", "麻 醉 者", "洗手护士", "本次手术是否属于非计划再次手术", "接生者",
|
|
|
+ "手术时间", "手术日期", "手术前诊断", "手术中诊断", "手术后诊断","手术指征", "手术人员", "外邀指导专家","麻醉方式", "麻醉人员", "麻 醉 者", "洗手护士", "本次手术是否属于非计划再次手术", "接生者",
|
|
|
"术前胎心", "手术名称", "术后诊断", "手术者及助手名称", "术中取病理标本", "麻醉方法", "手术经过(包括病人体位、切口处理、病灶所见及手术步骤等)",
|
|
|
- "诊断手术/操作简要经过(包括术中有无并发症及具体描述和处理)", "手术经过","医师签名","麻 醉","手术中诊断","手术前诊断",
|
|
|
+ "诊断手术/操作简要经过(包括术中有无并发症及具体描述和处理)", "手术经过","医师签名","麻 醉","术前诊断",
|
|
|
"医生签名", "记录时间", "时间", "手术/操作医生", "记录者", "术中输血", "术前宫颈准备日期", "药物名称及用法", "导管或其他", "插入深度",
|
|
|
"阴道填塞纱布条", "准备者", "取出日期", "手术方法", "术中特殊情况", "病理检查", "其他", "记录者", "手术者",
|
|
|
- "检查子宫位置","开始","结束"
|
|
|
+ "检查子宫位置","开始","结束","LMP"
|
|
|
);
|
|
|
titles = CommonAnalysisUtil.sortTitles(titles, text);
|
|
|
CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
|
|
@@ -136,5 +211,4 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
}
|