|
@@ -31,65 +31,55 @@ public class BeiLunConsultationHtmlAnalysis implements BeiLunHtmlAnalysis {
|
|
|
|
|
|
Map<String, String> structureMap = Maps.newLinkedHashMap();
|
|
|
String htmlContent = null;
|
|
|
- switch (recTypeId) {
|
|
|
- case "377":
|
|
|
- htmlContent = CommonAnalysisUtil.html2String(html);
|
|
|
- if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
- htmlContent = htmlContent.replaceAll("[ ]", " ");
|
|
|
- CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
|
|
|
+ if ("外院专家会诊申请单".equals(recTitle)) {
|
|
|
+ htmlContent = CommonAnalysisUtil.html2String(html);
|
|
|
+ if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
+ htmlContent = htmlContent.replaceAll("[ ]", " ");
|
|
|
+ CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
|
|
|
+ }
|
|
|
+ } else if ("协定方会诊".equals(recTitle)) {
|
|
|
+ htmlContent = CommonAnalysisUtil.html2String(html);
|
|
|
+ if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
+ htmlContent = htmlContent.replaceAll("[ ]", " ");
|
|
|
+ CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(structureMap.get("会诊时间"))) {
|
|
|
+ String[] strArr = structureMap.get("会诊时间").split(" ");
|
|
|
+ structureMap.put("会诊意见", strArr[strArr.length - 1]);
|
|
|
+ structureMap.put("会诊时间", strArr[0]);
|
|
|
+ }
|
|
|
+ } else if ("MDT会诊申请表".equals(recTitle) || "新-MDT会诊三合一".equals(recTitle)) {
|
|
|
+ titles = Lists.newArrayList("姓名", "性别", "出生日期", "联系电话",
|
|
|
+ "申请科室", "入院/首诊时间", "住院号", "病情概述(含主诉、病史、诊断、诊治过程等)", "拟申请MDT时间、地点",
|
|
|
+ "拟请MDT参加科室", "MDT目的", "申请人签名", "申请递交时间", "科主任签字", "专家诊治建议", "专家科室", "签名",
|
|
|
+ "填写时间", "主持科室小结(MDT的最终诊治决议)", "科主任(主持人)签名", "记录人(主管医师)签字", "日期");
|
|
|
+ htmlContent = CommonAnalysisUtil.html2String(html);
|
|
|
+ if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
+ htmlContent = htmlContent.replaceAll("[ ]", " ").replace("住院/门诊号", "");
|
|
|
+ StringBuffer sbf = new StringBuffer();
|
|
|
+ List<String> distinctText = Lists.newArrayList(htmlContent.split(" ")).stream().distinct().collect(Collectors.toList());
|
|
|
+ for (String text : distinctText) {
|
|
|
+ sbf.append(text).append(" ");
|
|
|
}
|
|
|
- structureMap.put("rec_title=", recTitle);
|
|
|
- break;
|
|
|
- case "7883":
|
|
|
- htmlContent = CommonAnalysisUtil.html2String(html);
|
|
|
- if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
- htmlContent = htmlContent.replaceAll("[ ]", " ");
|
|
|
- CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
|
|
|
+ CommonAnalysisUtil.html2StructureMapNoColon(titles, sbf.toString(), structureMap);
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(structureMap.get("主持科室小结(MDT的最终诊治决议)"))) {
|
|
|
+ String[] valueArray = structureMap.get("主持科室小结(MDT的最终诊治决议)").split(" ");
|
|
|
+ structureMap.put("主持科室小结(MDT的最终诊治决议)", valueArray[1]);
|
|
|
+ String v = valueArray[2];
|
|
|
+ String[] vArr = v.split(":");
|
|
|
+ if (vArr.length > 1) {
|
|
|
+ structureMap.put(vArr[0], vArr[1]);
|
|
|
}
|
|
|
- if (StringUtil.isNotBlank(structureMap.get("会诊时间"))) {
|
|
|
- String[] strArr = structureMap.get("会诊时间").split(" ");
|
|
|
- structureMap.put("会诊意见", strArr[strArr.length - 1]);
|
|
|
- structureMap.put("会诊时间", strArr[0]);
|
|
|
- }
|
|
|
- structureMap.put("rec_title=", recTitle);
|
|
|
- break;
|
|
|
- case "8084":
|
|
|
- titles = Lists.newArrayList("姓名", "性别", "出生日期", "联系电话",
|
|
|
- "申请科室", "入院/首诊时间", "住院号", "病情概述(含主诉、病史、诊断、诊治过程等)", "拟申请MDT时间、地点",
|
|
|
- "拟请MDT参加科室", "MDT目的", "申请人签名", "申请递交时间", "科主任签字", "专家诊治建议", "专家科室", "签名",
|
|
|
- "填写时间", "主持科室小结(MDT的最终诊治决议)", "科主任(主持人)签名", "记录人(主管医师)签字", "日期");
|
|
|
- htmlContent = CommonAnalysisUtil.html2String(html);
|
|
|
- if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
- htmlContent = htmlContent.replaceAll("[ ]", " ").replace("住院/门诊号", "");
|
|
|
- StringBuffer sbf = new StringBuffer();
|
|
|
- List<String> distinctText = Lists.newArrayList(htmlContent.split(" ")).stream().distinct().collect(Collectors.toList());
|
|
|
- for (String text : distinctText) {
|
|
|
- sbf.append(text).append(" ");
|
|
|
- }
|
|
|
- CommonAnalysisUtil.html2StructureMapNoColon(titles, sbf.toString(), structureMap);
|
|
|
- }
|
|
|
- if (StringUtil.isNotBlank(structureMap.get("主持科室小结(MDT的最终诊治决议)"))) {
|
|
|
- String[] valueArray = structureMap.get("主持科室小结(MDT的最终诊治决议)").split(" ");
|
|
|
- structureMap.put("主持科室小结(MDT的最终诊治决议)", valueArray[1]);
|
|
|
- String v = valueArray[2];
|
|
|
- String[] vArr = v.split(":");
|
|
|
- if (vArr.length > 1) {
|
|
|
- structureMap.put(vArr[0], vArr[1]);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- structureMap.put("rec_title=", recTitle);
|
|
|
- break;
|
|
|
- default:
|
|
|
- Document doc = Jsoup.parse(html);
|
|
|
- htmlContent = BeiLunHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
|
|
|
- //htmlContent = CommonAnalysisUtil.html2String(html);
|
|
|
- if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
- htmlContent = htmlContent.replaceAll("[ ]", " ");
|
|
|
- CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
|
|
|
- }
|
|
|
- //structureMap.put("rec_title=", "371");
|
|
|
- break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Document doc = Jsoup.parse(html);
|
|
|
+ htmlContent = BeiLunHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
|
|
|
+ //htmlContent = CommonAnalysisUtil.html2String(html);
|
|
|
+ if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
+ htmlContent = htmlContent.replaceAll("[ ]", " ");
|
|
|
+ CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
|
|
|
+ }
|
|
|
}
|
|
|
CommonAnalysisUtil.extractDateByTitle(structureMap, "会诊到达时间");
|
|
|
CommonAnalysisUtil.processType(structureMap, "会诊类型");
|