|
@@ -8,6 +8,7 @@ import org.jsoup.Jsoup;
|
|
import org.jsoup.nodes.Document;
|
|
import org.jsoup.nodes.Document;
|
|
import org.jsoup.nodes.Element;
|
|
import org.jsoup.nodes.Element;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -19,10 +20,25 @@ public class BeiLunBeHospitalizedHtmlAnalysis implements BeiLunHtmlAnalysis {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Map<String, String> analysis(String... args) {
|
|
public Map<String, String> analysis(String... args) {
|
|
|
|
+ Map<String, String> map = Maps.newLinkedHashMap();
|
|
String html = args[0];
|
|
String html = args[0];
|
|
String recTitle = args[1];
|
|
String recTitle = args[1];
|
|
Document doc = Jsoup.parse(html);
|
|
Document doc = Jsoup.parse(html);
|
|
- Map<String, String> map = Maps.newLinkedHashMap();
|
|
|
|
|
|
+
|
|
|
|
+ if (recTitle.contains("24小时")) {
|
|
|
|
+ analysis24h(doc, map);
|
|
|
|
+ } else if (recTitle.contains("日间病历")) {
|
|
|
|
+ analysisDay(doc, map);
|
|
|
|
+ } else {
|
|
|
|
+ analysisGeneral(doc, recTitle, map);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ BeiLunHtmlAnalysisUtil.insertModuleId(recTitle, map);
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //一般模板
|
|
|
|
+ private void analysisGeneral(Document doc, String recTitle, Map<String, String> map) {
|
|
//个人基础信息table解析
|
|
//个人基础信息table解析
|
|
BeiLunHtmlAnalysisUtil.tableStyle1InsertMap(doc.getElementById("table1"), map);
|
|
BeiLunHtmlAnalysisUtil.tableStyle1InsertMap(doc.getElementById("table1"), map);
|
|
//主诉、现病史等table解析
|
|
//主诉、现病史等table解析
|
|
@@ -75,8 +91,42 @@ public class BeiLunBeHospitalizedHtmlAnalysis implements BeiLunHtmlAnalysis {
|
|
.replace("补充专科情况", "补充专科情况:")
|
|
.replace("补充专科情况", "补充专科情况:")
|
|
.trim();
|
|
.trim();
|
|
CommonAnalysisUtil.cutByTitles(yuText, Lists.newArrayList("专科检查", "辅助检查"), 0, map);
|
|
CommonAnalysisUtil.cutByTitles(yuText, Lists.newArrayList("专科检查", "辅助检查"), 0, map);
|
|
- BeiLunHtmlAnalysisUtil.insertModuleId(recTitle, map);
|
|
|
|
- return map;
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //24小时出入院记录、24小时出入院记录(全院)、24小时入出院记录(全院通用)、24小时内入院死亡记录(全院通用)
|
|
|
|
+ private void analysis24h(Document doc, Map<String, String> map) {
|
|
|
|
+ String text = BeiLunHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), false);
|
|
|
|
+ text = text.substring(text.lastIndexOf("24小时入出院记录姓 名")).replaceFirst("第1页", "");
|
|
|
|
+ List<String> titles = Lists.newArrayList("姓 名", "家庭住址", "性 别", "工作单位", "年 龄", "身份证号码", "民 族",
|
|
|
|
+ "联系人(关系)", "职 业", "入院时间", "婚 姻", "死亡时间", "记录时间", "出 生 地", "病史陈述者", "主 诉", "入院情况", "心理评估",
|
|
|
|
+ "疼痛评估", "营养评估", "功能评估", "入院诊断", "诊疗经过", "死亡原因", "死亡诊断", "出院情况", "出院诊断", "出院计划", "出院医嘱",
|
|
|
|
+ "出院去向", "医师签名", "书写时间");
|
|
|
|
+
|
|
|
|
+ CommonAnalysisUtil.cutByTitles(text, titles, 0, map);
|
|
|
|
+ CommonAnalysisUtil.processType(map, "出院去向");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //原-日间病历入出院记录、日间病历-性早熟
|
|
|
|
+ private void analysisDay(Document doc, Map<String, String> map) {
|
|
|
|
+ //个人基础信息table解析
|
|
|
|
+ BeiLunHtmlAnalysisUtil.tableStyle1InsertMap(doc.getElementById("table1"), map);
|
|
|
|
+ //主诉、入院情况等table解析
|
|
|
|
+ BeiLunHtmlAnalysisUtil.tableStyle2InsertMap(doc.getElementById("table6"), map);
|
|
|
|
+ //医生签名、医生签名时间
|
|
|
|
+ Element docSignElement = null, docSignTimeElement = null;
|
|
|
|
+ for (Element table6ElementNt : doc.getElementById("table6").parent().nextElementSiblings()) {
|
|
|
|
+ docSignElement = table6ElementNt.selectFirst("image,img");
|
|
|
|
+ if (docSignElement != null) {
|
|
|
|
+ docSignTimeElement = table6ElementNt.nextElementSibling();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (docSignElement != null) {
|
|
|
|
+ map.put("医生签名", docSignElement.outerHtml());
|
|
|
|
+ }
|
|
|
|
+ if (docSignTimeElement != null) {
|
|
|
|
+ map.put("医生签名时间", BeiLunHtmlAnalysisUtil.elementLayer1ToStr(docSignTimeElement, false).trim());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void disHandleExt(Map<String, String> map) {
|
|
private void disHandleExt(Map<String, String> map) {
|
|
@@ -98,8 +148,8 @@ public class BeiLunBeHospitalizedHtmlAnalysis implements BeiLunHtmlAnalysis {
|
|
}
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
- String html = FileUtil.fileRead("C:/Users/Administrator/Desktop/宁波/病例导出/大病历-神经内科-神经内科-2258458.html");
|
|
|
|
- String recTitle = "大病历-神经内科";
|
|
|
|
|
|
+ String html = FileUtil.fileRead("C:/Users/Administrator/Desktop/宁波/病例导出/日间病历-性早熟-儿科-2265411.html");
|
|
|
|
+ String recTitle = "日间病历-性早熟";
|
|
BeiLunBeHospitalizedHtmlAnalysis test = new BeiLunBeHospitalizedHtmlAnalysis();
|
|
BeiLunBeHospitalizedHtmlAnalysis test = new BeiLunBeHospitalizedHtmlAnalysis();
|
|
Map<String, String> map = test.analysis(html, recTitle);
|
|
Map<String, String> map = test.analysis(html, recTitle);
|
|
map.keySet().forEach(key -> {
|
|
map.keySet().forEach(key -> {
|