|
@@ -28,17 +28,14 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
public Map<String, String> analysis(String... args) {
|
|
|
Map<String, String> map = Maps.newLinkedHashMap();
|
|
|
try {
|
|
|
- String html = args[0];
|
|
|
+ String html = args[0].replace(" ", " ");
|
|
|
String recTitle = args[1];
|
|
|
String recTypeId = args[2];
|
|
|
Element headerElement = Jsoup.parse(html).selectFirst("body").child(0).getElementById("header");
|
|
|
//宁海妇幼的手术记录header不是table
|
|
|
- if(headerElement.selectFirst("tbody")==null)
|
|
|
- {
|
|
|
+ if (headerElement.selectFirst("tbody") == null) {
|
|
|
analysisHeader(headerElement, map);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
NingHaiFuYaoHtmlAnalysisUtil.tableStyle1InsertMap(Jsoup.parse(html).selectFirst("body").child(0).getElementById("header"), map);
|
|
|
}
|
|
|
map.forEach((key, value) -> map.put(key, value.replace("\n", "")));
|
|
@@ -70,35 +67,53 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
String operatorDateStr = map.get("手术日期");
|
|
|
if (operatorDateStr.contains("--")) {
|
|
|
String[] operatorDate = operatorDateStr.split("--");
|
|
|
- map.put("手术开始时间", operatorDate[0]);
|
|
|
- map.put("手术结束时间", operatorDate[1]);
|
|
|
+ map.put("手术开始时间", operatorDate[0].replaceAll(":", ":")
|
|
|
+ .replaceAll(": ", ":")
|
|
|
+ .replaceAll(": ", ":"));
|
|
|
+ map.put("手术结束时间", operatorDate[1].replaceAll(":", ":")
|
|
|
+ .replaceAll(": ", ":")
|
|
|
+ .replaceAll(": ", ":"));
|
|
|
}
|
|
|
}
|
|
|
//宁海产科手术记录处理
|
|
|
- if(map.containsKey("开始")&&map.containsKey("结束")
|
|
|
- &&!map.containsKey("手术开始时间")&&!map.containsKey("手术结束时间")
|
|
|
- &&!map.containsKey("手术日期"))
|
|
|
- {
|
|
|
+ if (map.containsKey("开始") && map.containsKey("结束")
|
|
|
+ && !map.containsKey("手术开始时间") && !map.containsKey("手术结束时间")
|
|
|
+ && !map.containsKey("手术日期")) {
|
|
|
map.put("手术开始时间", map.get("开始"));
|
|
|
String endTime = map.get("结束");
|
|
|
- if(endTime.contains("手术名称"))
|
|
|
- {
|
|
|
+ if (endTime.contains("手术名称")) {
|
|
|
CommonAnalysisUtil.html2StructureMapNoColon
|
|
|
- (Lists.newArrayList("手术名称","术前诊断","手术指征","术后诊断"),endTime,map);
|
|
|
+ (Lists.newArrayList("手术名称", "术前诊断", "手术指征", "术后诊断"), endTime, map);
|
|
|
endTime = endTime.split("手术名称")[0].trim();
|
|
|
}
|
|
|
map.put("手术结束时间", endTime);
|
|
|
- map.put("手术日期",map.get("手术开始时间"));
|
|
|
+ map.put("手术日期", map.get("手术开始时间"));
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(map.containsKey("手术开始时间") && map.containsKey("手术结束时间")){
|
|
|
- map.put("手术日期",map.get("手术开始时间"));
|
|
|
+ if (map.containsKey("手术开始时间") && map.containsKey("手术结束时间")) {
|
|
|
+ map.put("手术日期", map.get("手术开始时间") + "-" + map.get("手术结束时间"));
|
|
|
+ }
|
|
|
+ if (map.containsKey("手术时间")) {
|
|
|
+ if (map.get("手术时间").contains("--")) {
|
|
|
+
|
|
|
+ } else if (map.get("手术时间").contains("-")) {
|
|
|
+ map.put("手术开始时间", map.get("手术时间").split("-")[0].replaceAll(":", ":")
|
|
|
+ .replaceAll(": ", ":")
|
|
|
+ .replaceAll(": ", ":"));
|
|
|
+ map.put("手术结束时间", map.get("手术时间").split("-")[1].replaceAll(":", ":")
|
|
|
+ .replaceAll(": ", ":")
|
|
|
+ .replaceAll(": ", ":"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (map.containsKey("手术时间") && map.get("手术时间").contains("-")) {
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//这些科室的手术时间写了好几种格式分别处理
|
|
|
// List<String> departmentList = Lists.newArrayList("妇科","十六病区VIP");
|
|
|
- getOperaTime(map,null);
|
|
|
+ getOperaTime(map, null);
|
|
|
CommonAnalysisUtil.makeEmpty(map, "医生签名");
|
|
|
NingHaiFuYaoHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
|
|
|
} catch (Exception e) {
|
|
@@ -107,71 +122,60 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
- private void getOperaTime(Map<String, String> map,List<String> departmentList) {
|
|
|
+ private void getOperaTime(Map<String, String> map, List<String> departmentList) {
|
|
|
// if(map.containsKey("病区")&&departmentList.contains(map.get("病区")))
|
|
|
- if(map.containsKey("病区"))
|
|
|
- {
|
|
|
+ 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(": ",":"));
|
|
|
+ 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("手术日期"));
|
|
|
+ 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));
|
|
|
+ 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)
|
|
|
- {
|
|
|
+ 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();
|
|
|
+ if (operationStartDateStr.contains("--")) {
|
|
|
+ operationStartDateStr = operationStartDateStr.substring(0, operationStartDateStr.lastIndexOf("--")).trim();
|
|
|
+ } else {
|
|
|
+ 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);
|
|
|
+ if (StringUtil.parseDateTime(operationStartDateStr, Content.dateFormats) != null) {
|
|
|
+ map.put("手术时间", operationStartDateStr);
|
|
|
}
|
|
|
}
|
|
|
//手术日期 -> 2021年01月15日15时25分- 2021年01月15日16时05分 无手术时间
|
|
|
- if(map.containsKey("手术日期"))
|
|
|
- {
|
|
|
+ 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));
|
|
|
+ map.put("手术日期", m.group(0));
|
|
|
}
|
|
|
}
|
|
|
//手术时间:2021-01-06 上午
|
|
|
- if(map.containsKey("手术时间"))
|
|
|
- {
|
|
|
- map.put("手术时间",map.get("手术时间")
|
|
|
- .replaceAll("上午","")
|
|
|
- .replaceAll("下午","")
|
|
|
- .replaceAll("中午","")
|
|
|
- .replaceAll("晚上","")
|
|
|
- .replaceAll("晚","")
|
|
|
- .replaceAll("凌晨","").trim());
|
|
|
+ if (map.containsKey("手术时间")) {
|
|
|
+ map.put("手术时间", map.get("手术时间")
|
|
|
+ .replaceAll("上午", "")
|
|
|
+ .replaceAll("下午", "")
|
|
|
+ .replaceAll("中午", "")
|
|
|
+ .replaceAll("晚上", "")
|
|
|
+ .replaceAll("晚", "")
|
|
|
+ .replaceAll("凌晨", "").trim());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -183,13 +187,13 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
String text = NingHaiFuYaoHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
|
|
|
text = text.replaceAll("第1页", "");
|
|
|
List<String> titles = Lists.newArrayList(
|
|
|
- "姓名", "性别", "出生日期", "出生年月", "科别", "科室", "病区", "床号", "床位", "住院号","手术开始时间","手术结束时间",
|
|
|
- "手术时间", "手术日期", "手术前诊断", "手术中诊断", "手术后诊断","手术指征", "手术人员", "外邀指导专家","麻醉方式", "麻醉人员", "麻 醉 者", "洗手护士", "本次手术是否属于非计划再次手术", "接生者",
|
|
|
+ "姓名", "性别", "出生日期", "出生年月", "科别", "科室", "病区", "床号", "床位", "住院号", "手术开始时间", "手术结束时间",
|
|
|
+ "手术时间", "手术日期", "手术前诊断", "手术中诊断", "手术后诊断", "手术指征", "手术人员", "外邀指导专家", "麻醉方式", "麻醉人员", "麻 醉 者", "洗手护士", "本次手术是否属于非计划再次手术", "接生者",
|
|
|
"术前胎心", "手术名称", "术后诊断", "手术者及助手名称", "术中取病理标本", "麻醉方法", "手术经过(包括病人体位、切口处理、病灶所见及手术步骤等)",
|
|
|
- "诊断手术/操作简要经过(包括术中有无并发症及具体描述和处理)", "手术经过","医师签名","麻 醉","术前诊断",
|
|
|
+ "诊断手术/操作简要经过(包括术中有无并发症及具体描述和处理)", "手术经过", "医师签名", "麻 醉", "术前诊断",
|
|
|
"医生签名", "记录时间", "时间", "手术/操作医生", "记录者", "术中输血", "术前宫颈准备日期", "药物名称及用法", "导管或其他", "插入深度",
|
|
|
"阴道填塞纱布条", "准备者", "取出日期", "手术方法", "术中特殊情况", "病理检查", "其他", "记录者", "手术者",
|
|
|
- "检查子宫位置","开始","结束","LMP"
|
|
|
+ "检查子宫位置", "开始", "结束", "LMP"
|
|
|
);
|
|
|
titles = CommonAnalysisUtil.sortTitles(titles, text);
|
|
|
CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
|
|
@@ -203,9 +207,9 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
|
|
|
}*/
|
|
|
String text = NingHaiFuYaoHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
|
|
|
text = text.replaceAll("第1页", "")
|
|
|
- .replaceAll("_____________________________________________________________________________________","");
|
|
|
+ .replaceAll("_____________________________________________________________________________________", "");
|
|
|
List<String> titles = Lists.newArrayList(
|
|
|
- "姓名", "病区", "床号", "住院号","年龄"
|
|
|
+ "姓名", "出生日期", "病区", "床号", "住院号", "年龄"
|
|
|
);
|
|
|
titles = CommonAnalysisUtil.sortTitles(titles, text);
|
|
|
CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
|