소스 검색

妇幼测试trans层bug修改

songxl 4 년 전
부모
커밋
1bf62c055c

+ 5 - 0
trans/src/main/java/com/lantone/qc/trans/ninghaifuyao/NingHaiFuYaoThreeLevelWardDocTrans.java

@@ -77,6 +77,11 @@ public class NingHaiFuYaoThreeLevelWardDocTrans extends ModelDocTrans {
         if (structureMap.containsKey("病情记录")) {
             structureMap.put("病情记录", structureMap.get("病情记录").replace(" ", ""));
         }
+        if(structureMap.containsKey("记录医生")&&StringUtil.isNotBlank(structureMap.get("记录医生"))
+                &&structureMap.get("病情记录").contains("医师签名"))
+        {
+            structureMap.put("病情记录", structureMap.get("病情记录").split("医师签名")[0]);
+        }
         //structureMap.put("查房日期", structureMap.get("记录时间"));
         /*Map<String, String> cutWordMap = Maps.newHashMap();
         String text = CxXmlUtil.getXmlText(content);

+ 3 - 1
trans/src/main/java/com/lantone/qc/trans/ninghaifuyao/util/NingHaiFuYaoFirstCourseRecordHtmlAnalysis.java

@@ -25,7 +25,9 @@ public class NingHaiFuYaoFirstCourseRecordHtmlAnalysis implements NingHaiFuYaoHt
     public Map<String, String> analysis(String... args) {
         Map<String, String> structureMap = Maps.newLinkedHashMap();
         try {
-            List<String> titles = Lists.newArrayList("一. 病例特点", "二. 拟诊讨论", "三. 诊疗计划","三、诊疗计划", "医师签名");
+            List<String> titles = Lists.newArrayList("一. 病例特点", "二. 拟诊讨论",
+                    "诊断依据","初步诊断","鉴别诊断","诊疗计划","医师签名",
+                    "三. 诊疗计划","三、诊疗计划", "医师签名");
             Document doc = Jsoup.parse(args[0]);
             String htmlContent = NingHaiFuYaoHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
             if (StringUtil.isNotBlank(htmlContent)) {

+ 25 - 1
trans/src/main/java/com/lantone/qc/trans/ninghaifuyao/util/NingHaiFuYaoOperationRecordHtmlAnalysis.java

@@ -28,7 +28,16 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            NingHaiFuYaoHtmlAnalysisUtil.tableStyle1InsertMap(Jsoup.parse(html).selectFirst("body").child(0).getElementById("header"), map);
+            Element headerElement = Jsoup.parse(html).selectFirst("body").child(0).getElementById("header");
+            //宁海妇幼的手术记录header不是table
+            if(headerElement.selectFirst("tbody")==null)
+            {
+                analysisHeader(headerElement, map);
+            }
+            else
+            {
+                NingHaiFuYaoHtmlAnalysisUtil.tableStyle1InsertMap(Jsoup.parse(html).selectFirst("body").child(0).getElementById("header"), map);
+            }
             map.forEach((key, value) -> map.put(key, value.replace("\n", "")));
             Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0).getElementById("main");
             analysisGeneral(bigDivElement, map);
@@ -112,4 +121,19 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
 
     }
 
+
+    private void analysisHeader(Element bigDivElement, Map<String, String> map) {
+        /*if (bigDivElement.selectFirst("hr") != null) {
+            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
+        }*/
+        String text = NingHaiFuYaoHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
+        text = text.replaceAll("第1页", "");
+        List<String> titles = Lists.newArrayList(
+                "姓名", "病区", "床号", "住院号"
+        );
+        titles = CommonAnalysisUtil.sortTitles(titles, text);
+        CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
+
+    }
+
 }