|
@@ -2,9 +2,12 @@ package com.lantone.qc.trans.xszyy.util;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
|
|
import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
|
|
|
|
+import com.lantone.qc.trans.xszyy.util.comsis.XszyyCommonAnalysisUtil;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jsoup.Jsoup;
|
|
import org.jsoup.Jsoup;
|
|
|
|
+import org.jsoup.nodes.Document;
|
|
import org.jsoup.nodes.Element;
|
|
import org.jsoup.nodes.Element;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -27,8 +30,17 @@ public class BeiLunTransferOutHtmlAnalysis implements BeiLunHtmlAnalysis {
|
|
String html = args[0];
|
|
String html = args[0];
|
|
String recTitle = args[1];
|
|
String recTitle = args[1];
|
|
String recTypeId = args[2];
|
|
String recTypeId = args[2];
|
|
- Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
|
|
|
|
- analysisGeneral(recTitle, bigDivElement, map);
|
|
|
|
|
|
+ Document doc = Jsoup.parse(html);
|
|
|
|
+ List<String> titles = Lists.newArrayList("患者姓名","性别","年龄","入院日期","转出日期","转入科室","主 诉","入院情况",
|
|
|
|
+ "入院诊断","诊疗经过","目前情况","目前诊断","转科目的及注意事项","书写医师"
|
|
|
|
+ );
|
|
|
|
+ String htmlContent = XszyyCommonAnalysisUtil.html2String(doc.toString());
|
|
|
|
+ if (StringUtil.isNotBlank(htmlContent)) {
|
|
|
|
+ //无冒号版本
|
|
|
|
+ XszyyCommonAnalysisUtil.html2StructureMapNoColon(titles,htmlContent,map);
|
|
|
|
+ map.put("标题",recTitle);
|
|
|
|
+ }
|
|
|
|
+
|
|
XszyyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
|
|
XszyyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
@@ -36,30 +48,4 @@ public class BeiLunTransferOutHtmlAnalysis implements BeiLunHtmlAnalysis {
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
- private void analysisGeneral(String recTitle, Element bigDivElement, Map<String, String> map) {
|
|
|
|
- if (bigDivElement.childNodeSize() == 1) {
|
|
|
|
- bigDivElement = bigDivElement.child(0);
|
|
|
|
- }
|
|
|
|
- if (bigDivElement.selectFirst("hr") != null) {
|
|
|
|
- bigDivElement.selectFirst("hr").previousElementSiblings().remove();
|
|
|
|
- }
|
|
|
|
- String text = XszyyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
|
|
|
|
- CommonAnalysisUtil.extractWardInfo(recTitle, text, map);
|
|
|
|
- String bqjlText = "病情记录" + map.get("病情记录").replace("年 月 日 时 分 ","");
|
|
|
|
- List<String> titles = Lists.newArrayList(
|
|
|
|
- "病情记录",
|
|
|
|
- "医师签名",
|
|
|
|
- "签名时间",
|
|
|
|
- "患者签名",
|
|
|
|
- "签名时间"
|
|
|
|
- );
|
|
|
|
- titles = CommonAnalysisUtil.sortTitlesNoColon(titles, bqjlText);
|
|
|
|
- CommonAnalysisUtil.cutByTitlesNoColon(bqjlText, titles, 0, map);
|
|
|
|
- List<String> tits = Lists.newArrayList(
|
|
|
|
- "签名时间",
|
|
|
|
- "患者签名"
|
|
|
|
- );
|
|
|
|
- tits = CommonAnalysisUtil.sortTitlesNoColon(tits, text);
|
|
|
|
- CommonAnalysisUtil.cutByTitlesNoColon(text, tits, 0, map);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|