江豪迪 преди 3 години
родител
ревизия
04fce845d1

+ 1 - 1
trans/src/main/java/com/lantone/qc/trans/hangzhoufubao/CriticallyIllNoticeDocTrans.java

@@ -42,7 +42,7 @@ public class CriticallyIllNoticeDocTrans extends ModelDocTrans {
     }
 
     private CriticallyIllNoticeDoc getCriticallyIllNoticeDoc(Map<String, Object> contentMap) {
-        String content = contentMap.get("xmlText").toString();
+        String content = contentMap.get("htmlText").toString();
         Map<String, String> structureMap = null;
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);

+ 4 - 1
trans/src/main/java/com/lantone/qc/trans/hangzhoufubao/util/BeHospitalizedHtmlAnalysis.java

@@ -62,7 +62,10 @@ public class BeHospitalizedHtmlAnalysis implements HtmlAnalysis {
         String reproductiveHistory = map.get("生育史");
         if (StringUtil.isNotBlank(reproductiveHistory)) {
             int index = reproductiveHistory.indexOf("孕次生产年月流产早产足月产");
-            map.put("生育史", reproductiveHistory.substring(0, index));
+            if (index > 0) {
+                map.put("生育史", reproductiveHistory.substring(0, index));
+
+            }
         }
 
 

+ 22 - 22
trans/src/main/java/com/lantone/qc/trans/hangzhoufubao/util/CriticallyIllNoticeHtmlAnalysis.java

@@ -26,40 +26,40 @@ public class CriticallyIllNoticeHtmlAnalysis implements HtmlAnalysis {
         Map<String, String> structureMap = Maps.newLinkedHashMap();
 
         try {
-            List<String> titles = Lists.newArrayList("姓名", "科别", "床号", "病案号",
-                    "1.简要病情", "2.目前诊断", "3.目前病情评估", "4.目前患者病情危重,随时出现以下一种或多种危及患者生命的并发症,且病情有进一步恶化\n" +
-                            "可能", "5.注意事项", "谈话医师签名", "签名日期", "时间", "6.患方知情选择",
-                    "患者签名", "指印", "患者签名时间", "若患者无法签署知情同意书或授权于亲属,请法定监护人或被授权人在此签名", "法定监护人/被授权人签名", "与患者关系", "法定监护人签名时间");
+            List<String> titles = Lists.newArrayList("姓名", "健康号", "年龄", "病区",
+                    "床号", "入院日期", "入院诊断", "病情概括及治疗措施", "可能的风险及预后", "医师签名", "时间", "患方签名");
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
             Document doc = Jsoup.parse(html);
             String htmlContent = HtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true)
-                    .replace("患者签名", "患者签名:")
-                    .replace("法定监护人/被授权人签名", "法定监护人/被授权人签名:")
-                    .replace("与患者关系", "与患者关系:")
-                    .replace("指印", "指印:")
-                    .replace("第1页", "");
+                    .replace("姓名", "姓名:")
+                    .replace("健康号", "健康号:")
+                    .replace("年龄", "年龄:")
+                    .replace("病区", "病区:")
+                    .replace("床号", "床号:")
+                    .replace("入院日期", "入院日期:");
+
 
-            int index1 = htmlContent.indexOf("患者签名");
-            int index2 = htmlContent.lastIndexOf("法定监护人/被授权人签名");
-            if (index1 != -1 && index2 != -1) {
-                htmlContent = htmlContent.substring(0, index1)
-                        + htmlContent.substring(index1, index2).replace("签名时间", "患者签名时间").replace("年    月    日    时    分", "")
-                        + htmlContent.substring(index2).replace("签名时间", "法定监护人签名时间").replace("年    月    日    时    分", "");
-            }
 
             if (StringUtil.isNotBlank(htmlContent)) {
                 htmlContent = htmlContent.replaceAll("[   ]", " ");
                 CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
             }
-            structureMap.put("患者签名", structureMap.get("患者签名").replace("患者签名", ""));
-            if (StringUtil.isNotBlank(structureMap.get("法定监护人/被授权人签名"))) {
-                structureMap.put("法定监护人/被授权人签名", structureMap.get("法定监护人/被授权人签名").replace("患方签名", ""));
+            //拆分患方签名时间
+            String s = structureMap.get("患方签名");
+            if (StringUtil.isNotBlank(s)) {
+                int index = s.indexOf("时间:");
+                if (index == -1) {
+                    index = s.indexOf("时间:");
+
+                }
+                if (index != -1) {
+                    structureMap.put("患方签名", s.substring(0, index));
+                    structureMap.put("患方签名时间", s.substring(index + 3));
+                }
             }
-            CommonAnalysisUtil.processTypeRight(structureMap, "3.目前病情评估");
-            CommonAnalysisUtil.processType(structureMap, "6.患方知情选择");
-            CommonAnalysisUtil.processType(structureMap, "指印");
+
             HtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
             log.error(e.getMessage(), e);