Ver código fonte

术前小结解析修改

rengb 4 anos atrás
pai
commit
e83330e176

+ 9 - 69
trans/src/main/java/com/lantone/qc/trans/beilun/BeiLunOperationDocTrans.java

@@ -14,6 +14,8 @@ import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.beilun.util.BeiLunHtmlAnalysis;
+import com.lantone.qc.trans.beilun.util.BeiLunPreoperativeHtmlAnalysis;
 import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
 import com.lantone.qc.trans.comsis.Preproc;
@@ -268,80 +270,18 @@ public class BeiLunOperationDocTrans extends ModelDocTrans {
 
     private PreoperativeDiscussionDoc getPreoperativeDiscussionDoc(Map<String, Object> contentMap) {
         String content = contentMap.get("xmlText").toString();
-        Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue(content);
-        xmlNodeValueMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-        xmlNodeValueMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, preoperativeDiscussion_keyContrasts);
-        structureMap.put(
-                "术前准备内容",
-                (StringUtil.isBlank(structureMap.get("术前准备内容")) ? "" : structureMap.get("术前准备内容")) + (StringUtil.isBlank(structureMap.get("术前准备++++术前准备情况")) ? "" : structureMap.get("术前准备++++术前准备情况"))
-        );
-        structureMap.put(
-                "术前术后注意事项",
-                (StringUtil.isBlank(structureMap.get("术前术后注意事项")) ? "" : structureMap.get("术前术后注意事项")) + (StringUtil.isBlank(structureMap.get("术后注意事项")) ? "" : structureMap.get("术后注意事项"))
-        );
-        structureMap.put("讨论时间", structureMap.get("记录时间"));
-        if (StringUtil.isNotBlank(structureMap.get("签名"))) {
-            structureMap.put("记录医师", structureMap.get("签名"));
-        }
-        if (StringUtil.isNotBlank(structureMap.get("拟行治疗指征及禁忌症"))) {
-            structureMap.put("拟行术式", structureMap.get("拟行治疗指征及禁忌症"));
-        } else if (StringUtil.isNotBlank(structureMap.get("拟施手术方式"))) {
-            structureMap.put("拟行术式", structureMap.get("拟施手术方式"));
-        }
-
-
-        String text = CxXmlUtil.getXmlText(content);
-        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, preoperativeDiscussion_sourceTitles, text);
-        cutWordMap.putAll(structureMap);
-
-        PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(cutWordMap);
-        preoperativeDiscussionDoc.setText(text);
-        preoperativeDiscussionDoc.setPageData((Map) cutWordMap);
+        String recTitle = contentMap.get("recTitle").toString();
+        BeiLunHtmlAnalysis beiLunHtmlAnalysis = new BeiLunPreoperativeHtmlAnalysis();
+        Map<String, String> sourceMap = beiLunHtmlAnalysis.analysis(content, recTitle);
+        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, preoperativeDiscussion_keyContrasts);
 
+        PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(structureMap);
+        preoperativeDiscussionDoc.setPageData((Map) structureMap);
         return preoperativeDiscussionDoc;
     }
 
-    private List<String> preoperativeDiscussion_sourceTitles = Lists.newArrayList(
-            "记录医师",
-            "记录时间",
-            "讨论时间",
-            "讨论方式",
-            "参加人员",
-            "简要病情",
-            "讨论结论",
-            "经治医师签名",
-            "经治医师签字时间",
-            "主刀医师签名",
-            "主刀医师签字时间",
-            "手术指征",
-            "麻醉方式",
-            "术前准备内容",
-            "术前术后注意事项",
-            "可能意外和防范措施",
-            "拟行术式",
-            "拟施手术方式、名称及可能的变更与禁忌征"
-    );
-
     private List<String> preoperativeDiscussion_keyContrasts = Lists.newArrayList(
-            "讨论时间++++记录日期=记录时间",
-            "签字时间=主刀医师签字时间",
-            "参加人员姓名=参加人员",
-            "病情摘要++++简要病情=简要病情",
-            "术前诊断++++初步诊断=术前诊断",
-            "手术指征与禁忌征++++手术指征=手术指征",
-            "拟行治疗指征及禁忌症=",
-            "拟施麻醉方式=麻醉方式",
-            "术前准备情况=术前准备内容",
-            "术前准备++++术前准备情况=",
-            "手术风险及预防措施++++文本框=可能意外和防范措施",
-            "术中注意事项=术前术后注意事项",
-            "术后注意事项=",
-            "目前使用的药物=目前服用药物",
-            "诊疗计划=治疗计划和措施",
-            "注意事项=术前术后注意事项",
-            "手术名称及方式=拟施手术方式名称及可能的变更与禁忌症",
-            "拟施手术方式、名称及可能的变更与禁忌征=拟施手术方式名称及可能的变更与禁忌症"
+
     );
 
 

+ 68 - 0
trans/src/main/java/com/lantone/qc/trans/beilun/util/BeiLunPreoperativeHtmlAnalysis.java

@@ -0,0 +1,68 @@
+package com.lantone.qc.trans.beilun.util;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.FileUtil;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Element;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/9/17 19:19
+ */
+public class BeiLunPreoperativeHtmlAnalysis implements BeiLunHtmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        Map<String, String> map = Maps.newLinkedHashMap();
+        String html = args[0];
+        String recTitle = args[1];
+        Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
+
+        if (recTitle.equals("术前小结")) {
+
+        } else {
+            analysisGeneral(bigDivElement, map);
+        }
+
+        BeiLunHtmlAnalysisUtil.mapValueRemoveStartColon(map);
+        //        BeiLunHtmlAnalysisUtil.insertModuleId(recTitle, map);
+        return map;
+    }
+
+    //术前讨论及术前小结、术前讨论及术前小结-打印可选、(四级手术、疑难手术)术前讨论及术前小结、术前讨论
+    private void analysisGeneral(Element bigDivElement, Map<String, String> map) {
+        bigDivElement.selectFirst("hr").previousElementSiblings().remove();
+        String text = BeiLunHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
+
+        int index1 = text.lastIndexOf("经治医生签名");
+        int index2 = text.lastIndexOf("主刀医生签名");
+        text = text.substring(0, index1).replace("(如高血压病、冠心病、糖尿病、脑梗、心梗、心肺肝肾功能不全,口服抗凝药", "")
+                .replace("等)", "").replace("(如腹腔镜可能改开腹等)", "")
+                + text.substring(index1, index2).replace("签字时间", "经治医生签字时间").replace("年月日时分", "")
+                + text.substring(index2).replace("签字时间", "主刀医生签字时间").replace("年月日时分", "");
+
+        List<String> titles = Lists.newArrayList("讨论时间", "讨论方式", "参加人员", "简要病情", "具体讨论意见",
+                "术前诊断", "手术指征与禁忌征", "可替代方案", "拟施手术方式(名称)及可能的变更方案", "计划性多次手术",
+                "拟施麻醉方式", "术前特殊准备", "主要术中、术后风险及防范措施", "术中、术后注意事项(含护理事项)",
+                "经治医生签名", "经治医生签字时间", "主刀医生签名", "主刀医生签字时间");
+        CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
+        CommonAnalysisUtil.processType(map, "计划性多次手术");
+        CommonAnalysisUtil.processType(map, "讨论方式");
+    }
+
+    public static void main(String[] args) {
+        String html = FileUtil.fileRead("C:/Users/Administrator/Desktop/宁波/病例导出/术前讨论及术前小结-耳鼻喉科-2258069.html");
+        String recTitle = "术前讨论及术前小结";
+        BeiLunPreoperativeHtmlAnalysis test = new BeiLunPreoperativeHtmlAnalysis();
+        Map<String, String> map = test.analysis(html, recTitle);
+        map.keySet().forEach(key -> {
+            System.out.println(key + "-----" + map.get(key));
+        });
+    }
+
+}