Browse Source

义务中心医院:页面解析

rengb 4 years ago
parent
commit
74858e1dc9
34 changed files with 979 additions and 1276 deletions
  1. 33 408
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyBeHospitalizedDocTrans.java
  2. 31 16
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyClinicBloodEffectDocTrans.java
  3. 28 32
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyClinicalBloodDocTrans.java
  4. 31 18
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyCrisisValueReportDocTrans.java
  5. 32 15
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyCriticallyIllNoticeDocTrans.java
  6. 31 33
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyDeathCaseDiscussDocTrans.java
  7. 32 29
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyDeathRecordDocTrans.java
  8. 31 32
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyDifficultCaseDiscussDocTrans.java
  9. 38 131
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyFirstCourseRecordDocTrans.java
  10. 54 53
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyLeaveHospitalDocTrans.java
  11. 98 326
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyOperationDocTrans.java
  12. 30 41
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyRescueDocTrans.java
  13. 30 34
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyStagesSummaryDocTrans.java
  14. 36 32
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyThreeLevelWardDocTrans.java
  15. 124 76
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyTransferRecordDocTrans.java
  16. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyBeHospitalizedXmlAnalysis.java
  17. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyClinicBloodEffectXmlAnalysis.java
  18. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyClinicalBloodXmlAnalysis.java
  19. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyCrisisValueReportXmlAnalysis.java
  20. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyCriticallyIllNoticeXmlAnalysis.java
  21. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyDeathCaseDiscussXmlAnalysis.java
  22. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyDeathRecordXmlAnalysis.java
  23. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyDifficultCaseDiscussXmlAnalysis.java
  24. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyFirstCourseRecordXmlAnalysis.java
  25. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyLeaveHospitalXmlAnalysis.java
  26. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyOperationDiscussionXmlAnalysis.java
  27. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyOperationRecordXmlAnalysis.java
  28. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyPreoperativeDiscussionXmlAnalysis.java
  29. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyRescueXmlAnalysis.java
  30. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyStagesSummaryXmlAnalysis.java
  31. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyThreeLevelWardXmlAnalysis.java
  32. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyTransferIntoXmlAnalysis.java
  33. 17 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyTransferOutXmlAnalysis.java
  34. 14 0
      trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyXmlAnalysis.java

+ 33 - 408
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyBeHospitalizedDocTrans.java

@@ -1,31 +1,16 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
-import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
-import com.lantone.qc.pub.model.label.ChiefLabel;
-import com.lantone.qc.pub.model.label.DiagLabel;
-import com.lantone.qc.pub.model.label.FamilyLabel;
-import com.lantone.qc.pub.model.label.MaritalLabel;
-import com.lantone.qc.pub.model.label.MenstrualLabel;
-import com.lantone.qc.pub.model.label.PacsLabel;
-import com.lantone.qc.pub.model.label.PastLabel;
-import com.lantone.qc.pub.model.label.PersonalLabel;
-import com.lantone.qc.pub.model.label.PresentLabel;
-import com.lantone.qc.pub.model.label.VitalLabel;
-import com.lantone.qc.pub.model.label.VitalLabelSpecial;
-import com.lantone.qc.pub.model.vo.BehospitalInfoVO;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
-import com.lantone.qc.pub.util.SpringContextUtil;
-import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
-import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
-import org.apache.commons.lang3.StringUtils;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyBeHospitalizedXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -35,406 +20,46 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/5 15:47
  */
+@Slf4j
 public class YwzxyyBeHospitalizedDocTrans extends ModelDocTrans {
-    private String modeId = "1";
 
-    /**
-     * @param medrecVo
-     * @return
-     */
     @Override
     public BeHospitalizedDoc extract(MedrecVo medrecVo) {
-        Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
-        String content = contentMap.get("xmlText").toString();
-        SpecialStorageUtil specialStorageUtil = SpringContextUtil.getBean("specialStorageUtil");
-        BehospitalInfoVO behospitalInfoVO = specialStorageUtil.getBehospitalInfoThreadLocal().get();
-        Map<String, String> structureMap = null;
-        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
-            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
-        } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            String text = sourceMap.get("原始文本").replace(":", ":").replaceAll("■", "");
-            //日间病历单独处理
-            String behDeptId = behospitalInfoVO.getBehDeptId();
-            if ("51923".equals(behDeptId) || "52883".equals(behDeptId) || "52903".equals(behDeptId) || "52923".equals(behDeptId) || "53523".equals(behDeptId)) {
-                Map<String, String> dailyTrans = dailyTrans(text, behDeptId);
-                mapJoin(sourceMap, dailyTrans);
+        BeHospitalizedDoc beHospitalizedDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
             } else {
-                Map<String, String> cutMap = Maps.newHashMap();
-                List<String> titles = Lists.newArrayList("婚    姻", "联系地址", "工作单位", "入院日期", "婚姻状况", "住      址", "出生日期", "联系 电话", "职    业", "身份证号码", "供 史 者", "主  诉", "性      别", "主    诉", "婚  姻", "籍      贯", "民  族", "民    族", "个人史", "个 人 史", "妇科检查", "产科检查",
-                        "实验室", "诊断和诊断修正", "婚 育 史", "家 族 史", "体格检查(一)", "体 格 检 查(一)", "现 病 史", "既往史", "既 往 史", "月 经 史", "系统回顾", "其他", "职        业", "联系人及电话");
-                List<String> sortTitles = CommonAnalysisUtil.sortTitlesNoColon(titles, text);
-                CommonAnalysisUtil.cutByTitlesNoColon(text, sortTitles, 0, cutMap);
-                List<String> modifyKey = Lists.newArrayList("初步诊断", "修正诊断", "补充诊断");
-                sortTitles = CommonAnalysisUtil.sortTitlesNoColon(modifyKey, text);
-                if (text.contains("初步诊断:")) {
-                    text = text.substring(text.indexOf("初步诊断:")).replaceAll("[ ]", "");
-                    for (String key : sortTitles) {
-                        text = modifyDiagKey(text, key);
-                    }
-                    modifyKey = Lists.newArrayList("初步诊断", "修正诊断", "补充诊断", "初步诊断医师", "修正诊断医师", "补充诊断医师", "初步诊断时间", "修正诊断时间", "补充诊断时间");
-                    sortTitles = CommonAnalysisUtil.sortTitles(modifyKey, text);
-                    CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, cutMap);
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyBeHospitalizedXmlAnalysis();
+                Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "1");
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
                 }
-                if (sourceMap.containsKey("修正诊断") && (sourceMap.get("修正诊断").contains(":") || sourceMap.get("修正诊断").contains(":"))) {
-                    sourceMap.put("修正诊断", "");
-                }
-                //妇科日间出院医嘱部分特殊处理
-                List<String> titles1 = Lists.newArrayList("注意事项", "医生办公室电话", "随访安排", "活动能力与生活自理情况"
-                        , "出院带药", "出院去向");
-                String text1 = sourceMap.get("出院医嘱");
-                if (text1 != null) {
-                    text1.replaceAll("[0-9,、]", "");
-                    List<String> sortTitles1 = CommonAnalysisUtil.sortTitles(titles1, text1);
-                    CommonAnalysisUtil.cutByTitles(text1, sortTitles1, 0, cutMap);
-                }
-                sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-                sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-
-                //产科孕产次
-                if (sourceMap.containsKey("入院记录")) {
-                    String value = sourceMap.get("入院记录").split(" ")[0];
-                    sourceMap.put("孕产次", value);
-                }
-                //产科入院记录个人史处理
-                if (sourceMap.containsKey("个人史")) {
-                    String value = sourceMap.get("个人史").split("月经史")[0];
-                    sourceMap.put("个人史", value);
-                }
-
-                //入院记录标题部分解析不出的  婚姻和民族处理
-                //注意中间的空格是什么字符
-                List<String> titletitles = Lists.newArrayList("住      址",
-                        "婚  姻", "民  族", "民    族", "供 史 者", "性      别", "婚    姻", "婚姻状况", "病史提供者", "职业", "联系人及电话");
-                for (String str : titletitles) {
-                    String str1 = str.replaceAll("[  ]", "");
-                    if (sourceMap.containsKey(str)) {
-                        String value = (sourceMap.get(str).split(" ")[0]).split("\\\\n")[0];
-                        sourceMap.put(str1, value);
-                    }
-                    if (sourceMap.containsKey(str1)) {
-                        String value = (sourceMap.get(str1).split(" ")[0]).split("\\\\n")[0];
-                        sourceMap.put(str1, value);
-                    }
-                }
-                mapJoin(sourceMap, cutMap);
             }
-
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
-            OrdinaryAssistant.removeBlank(structureMap);
-        }
-        //姓名+姓名问题解决
-        if (structureMap.containsKey("姓名")) {
-            String value = structureMap.get("姓名").split(" ")[0];
-            structureMap.put("姓名", value);
+            if (MapUtils.isNotEmpty(structureMap)) {
+                beHospitalizedDoc = ModelDocGenerate.beHospitalizedDocGen(structureMap);
+                beHospitalizedDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
         }
-        //如果有入院时间,优先使用
-        addKeyMapping(structureMap, "入院时间", "入病房时间");
-        //如果有职业,优先使用
-        addKeyMapping(structureMap, "职业", "工作性质");
-        BeHospitalizedDoc beHospitalizedDoc = beHospitalizedDocGen(structureMap); // 不走共用
-        beHospitalizedDoc.setPageData((Map) structureMap);
-        //structureMap.forEach((k, v) -> System.out.println(k + "\n" + v + "\n----------------------------------------"));
         return beHospitalizedDoc;
     }
 
-    private void mapJoin(Map<String, String> sourceMap, Map<String, String> dailyTrans) {
-        dailyTrans.forEach((k, v) -> {
-            if (!sourceMap.containsKey(k)) {
-                sourceMap.put(k, v);
-            }
-        });
-    }
-
     private List<String> keyContrasts = Lists.newArrayList(
-            "初步诊断医师=初步诊断医师签名",
-            "修正诊断医师=修正诊断医师签名",
-            "补充诊断医师=补充诊断医师签名",
-            "初步诊断时间=初步诊断日期",
-            "补充诊断时间=补充诊断日期",
-            "补充诊断时间=补充诊断日期",
-            "本人姓名=姓名",
-            "性别=性别",
-            "年龄=年龄",
-            "民族=民族",
-            "职业=职业",
-            "出生地址=出生地",
-            "出生、生长史=出生生长史",
-            "地址=联系地址",
-            "工作场所=工作单位",
-            "患者工作单位名称=工作单位",
-            "信息来源=病史陈述者",
-            "生日=出生日期",
-            "出生时间=出生日期",
-            "病人出生日期=出生日期",
-            "新生儿出生日期=出生日期",
-            //            "出生地址=户口地址",
-            "本人电话=联系电话电话",
-            "入病房时间=入院日期",
-            "病历日期=记录日期",
-            "主诉=主诉",
-            "现病史=现病史",
-            "内科疾病史(其它)=内科疾病史其它",
-            "一般健康状况=既往健康状况",
-            "婚姻家庭关系和睦=夫妻关系",
-            "体格检查=体格检查",
-            "初步诊断=初步诊断",
-            "修正诊断=修正诊断",
-            "医生=医师签名",
-            "补充诊断=补充诊断",
-            //            "户口地址=联系地址",
-            "家属提供的信息可信吗=病史可靠性",
-            "入院诊断(中医疾病)=中医诊断",
-            "长期用药情况(包括可能成瘾的药物)=长期用药",
-            "体温(口)=体温",
-            "性别代码=性别",
-            "家庭住址=户口地址",
-            "联系人电话号码=联系电话",
-            "家长姓名=联系人",
-            "联系人姓名=联系人",
-            "患者出生地址=出生地",
-            "入院日期时间=入院日期",
-            "现住址=户口地址",
-            //            "_{K4}=性别",
-            "联系住址=户口地址",
-            "联系地址=户口地址",
-            "患者工作单位名称=户口地址",
-            "出生日期时间=出生日期",
-            //            "医生签名=初步诊断医师签名",
-            "签字日期=初步诊断日期",
-            "供史者=病史陈述者",
-            "无痛人流主诉=主诉",
-            "联系人电话=联系电话",
-            "医师签字时间=初步诊断日期",
-            "医师签名时间=初步诊断日期",
-            "入院诊断编码=初步诊断",
-            "婚姻=婚姻状况",
-            "病史提供者=病史陈述者",
-            "家庭地址=户口地址",
-            "患者手机号码=联系电话",
-            "孕 产次=孕产次",
-            "有/无=产前检查",
-            "末次月经日期=末次月经",
-            "入院诊断1=入院诊断",
-            //            "记录医师=初步诊断医师签名",
-            "修正诊断签名日期=修正诊断日期",
-            "修正诊断一医师签名=修正诊断医师签名",
-            "患者姓名=姓名",
-            "年月日=初步诊断日期",
-            "年月日时分=初步诊断日期",
-            "诊疗经过=诊疗情况",
-            "随访安排=随访计划",
-            "活动能力与生活自理情况=出院医嘱",
-            "患者籍贯新=籍贯",
-            "现住址邮编=邮政编码",
-            "患者签名时间=初步诊断日期",
-            "日期=初步诊断日期",
-            "骨盆外测量=专科检查",
-            "婚姻=婚姻状况",
-            "住址=户口地址",
-            "患者籍贯=出生地",
-            "他=其他",
-            "入院诊断1=初步诊断",
-            "出院诊断1=出院诊断",
-            "主刀医师签名=记录医师",
-            "签名医师=记录医师",
-            "时间=记录时间",
-            "诊断和诊断修正=修正诊断"
+            "联系人(关系)=联系人",
+            "入院时间=入院日期",
+            "医生签名=记录医生",
+            "医生签名时间=记录时间",
+            "疼痛评估=疼痛",
+            "代诉=主诉"
     );
 
-
-    /**
-     * 入院记录
-     *
-     * @param structureMap
-     * @return
-     */
-    public static BeHospitalizedDoc beHospitalizedDocGen(Map<String, String> structureMap) {
-        BeHospitalizedDoc beHospitalizedDoc = new BeHospitalizedDoc();
-
-        // 走模型
-        ChiefLabel chiefLabel = new ChiefLabel();
-        chiefLabel.setText(structureMap.get("主诉"));
-        beHospitalizedDoc.setChiefLabel(chiefLabel);
-        if (StringUtil.isBlank(structureMap.get("主诉"))) {
-            beHospitalizedDoc.setChiefLabel(null);
-        }
-
-        // 走模型
-        PresentLabel presentLabel = new PresentLabel();
-        if (StringUtil.isNotBlank(structureMap.get("现病史"))) {
-            presentLabel.setText(structureMap.get("现病史"));
-        } else if (StringUtil.isNotBlank(structureMap.get("入院情况"))) {
-            presentLabel.setText(structureMap.get("入院情况"));
-        }
-        beHospitalizedDoc.setPresentLabel(presentLabel);
-
-        PastLabel pastLabel = new PastLabel();
-        pastLabel.setCrfLabel(false);
-        if (StringUtil.isNotBlank(structureMap.get("既往史"))) {
-            pastLabel.setText(structureMap.get("既往史"));
-        } else if (StringUtil.isNotBlank(structureMap.get("入院情况"))) {
-            pastLabel.setText(structureMap.get("入院情况"));
-        }
-        beHospitalizedDoc.setPastLabel(pastLabel);
-
-        PersonalLabel personalLabel = new PersonalLabel();
-        //        personalLabel.setCrfLabel(false);
-        personalLabel.setText(structureMap.get("个人史"));
-        beHospitalizedDoc.setPersonalLabel(personalLabel);
-        if (StringUtil.isBlank(structureMap.get("个人史"))) {
-            beHospitalizedDoc.setPersonalLabel(null);
-        }
-
-        MaritalLabel maritalLabel = new MaritalLabel();
-        //        maritalLabel.setCrfLabel(false);
-        maritalLabel.setText("婚育史: " + structureMap.get("婚育史"));
-        beHospitalizedDoc.setMaritalLabel(maritalLabel);
-        if (StringUtil.isBlank(structureMap.get("婚育史"))) {
-            beHospitalizedDoc.setMaritalLabel(null);
-        }
-
-        MenstrualLabel menstrualLabel = new MenstrualLabel();
-        //        menstrualLabel.setCrfLabel(false);
-        menstrualLabel.setText("月经史:" + structureMap.get("月经史"));
-        beHospitalizedDoc.setMenstrualLabel(menstrualLabel);
-        if (StringUtil.isBlank(structureMap.get("月经史"))) {
-            beHospitalizedDoc.setMenstrualLabel(null);
-        }
-
-        FamilyLabel familyLabel = new FamilyLabel();
-        //        familyLabel.setCrfLabel(false);
-        familyLabel.setText(structureMap.get("家族史"));
-        beHospitalizedDoc.setFamilyLabel(familyLabel);
-        if (StringUtil.isBlank(structureMap.get("家族史"))) {
-            beHospitalizedDoc.setFamilyLabel(null);
-        }
-
-        VitalLabel vitalLabel = new VitalLabel();
-        //        vitalLabel.setCrfLabel(false);
-        vitalLabel.setText(structureMap.get("体格检查"));
-        beHospitalizedDoc.setVitalLabel(vitalLabel);
-        if (StringUtil.isBlank(structureMap.get("体格检查"))) {
-            beHospitalizedDoc.setVitalLabel(null);
-        }
-
-        VitalLabelSpecial vitalLabelSpecial = new VitalLabelSpecial();
-        //        vitalLabelSpecial.setCrfLabel(false);
-        vitalLabelSpecial.setText(structureMap.get("专科体格检查"));
-        beHospitalizedDoc.setVitalLabelSpecial(vitalLabelSpecial);
-        if (StringUtil.isBlank(structureMap.get("专科体格检查"))) {
-            beHospitalizedDoc.setVitalLabelSpecial(null);
-        }
-
-        // 走模型
-        PacsLabel pacsLabel = new PacsLabel();
-        //        pacsLabel.setCrfLabel(false);
-        pacsLabel.setText(structureMap.get("辅助检查"));
-        beHospitalizedDoc.setPacsLabel(pacsLabel);
-        if (StringUtil.isBlank(structureMap.get("辅助检查"))) {
-            beHospitalizedDoc.setPacsLabel(null);
-        }
-
-        // 走模型
-        DiagLabel initialDiagLabel = new DiagLabel();
-        initialDiagLabel.setText(structureMap.get("初步诊断"));
-        beHospitalizedDoc.setInitialDiagLabel(initialDiagLabel);
-        if (StringUtil.isBlank(structureMap.get("初步诊断"))) {
-            beHospitalizedDoc.setInitialDiagLabel(null);
-        }
-
-        // 走模型
-        DiagLabel revisedDiagLabel = new DiagLabel();
-        revisedDiagLabel.setText(structureMap.get("修正诊断"));
-        beHospitalizedDoc.setRevisedDiagLabel(revisedDiagLabel);
-        if (StringUtil.isBlank(structureMap.get("修正诊断"))) {
-            beHospitalizedDoc.setRevisedDiagLabel(null);
-        }
-
-        // 走模型
-        DiagLabel suppleDiagLabel = new DiagLabel();
-        suppleDiagLabel.setText(structureMap.get("补充诊断"));
-        beHospitalizedDoc.setSuppleDiagLabel(suppleDiagLabel);
-        if (StringUtil.isBlank(structureMap.get("补充诊断"))) {
-            beHospitalizedDoc.setSuppleDiagLabel(null);
-        }
-
-        beHospitalizedDoc.setStructureMap(structureMap);
-
-        return beHospitalizedDoc;
-    }
-
-    /**
-     * 给structureMap添加一个key(映射)
-     *
-     * @param structureMap
-     * @param target       需要用到的key
-     * @param source       structureMap中含有的key
-     */
-    protected void addKeyMapping(Map<String, String> structureMap, String target, String source) {
-        if (StringUtils.isEmpty(structureMap.get(target)) && StringUtils.isNotEmpty(structureMap.get(source))) {
-            structureMap.put(target, structureMap.get(source));
-        }
-    }
-
-    /**
-     * 日间病历解析全用切词方式
-     *
-     * @param text
-     * @param behDeptId
-     */
-    private Map<String, String> dailyTrans(String text, String behDeptId) {
-        Map<String, String> parseMap = Maps.newHashMap();
-        List<String> titles = Lists.newArrayList();
-        switch (behDeptId) {
-            case "51923":
-                titles = Lists.newArrayList("姓名", "出生日期", "出生地", "其他", "辅助检查", "与患者关系", "性别",
-                        "年龄", "职业", "入院时间", "婚姻", "出院时间", "民族", "身份证号", "联系电话", "邮政编码",
-                        "工作单位", "联系地址", "病史提供者", "病史陈述者", "主诉", "入院情况", "月 经 史", "婚 育 史", "体格检查", "妇科检查", "入院诊断", "诊疗情况",
-                        "诊疗经过", "出院情况", "出院诊断", "出院医嘱", "医师签名", "记录医师", "主刀医师签名",
-                        "记录时间", "时间");
-                break;
-            case "52883":
-                titles = Lists.newArrayList("姓名", "出生日期", "出生地", "其他", "辅助检查", "与患者关系", "性别",
-                        "年龄", "职业", "入院时间", "婚姻", "出院时间", "民族", "身份证号", "联系电话", "邮政编码",
-                        "工作单位", "联系地址", "病史提供者", "病史陈述者", "主诉", "入院情况", "入院诊断", "诊疗情况",
-                        "诊疗经过", "出院情况", "出院诊断", "出院医嘱", "注意事项", "出院带药", "随访计划", "医师签名",
-                        "记录医师", "记录时间", "时间");
-                break;
-            case "52903":
-                titles = Lists.newArrayList("姓名", "出生日期", "出生地", "其他", "辅助检查", "与患者关系", "性别",
-                        "年龄", "职业", "入院时间", "婚姻", "出院时间", "民族", "身份证号", "联系电话", "邮政编码",
-                        "工作单位", "联系地址", "病史提供者", "病史陈述者", "主诉", "入院情况", "入院诊断", "诊疗情况",
-                        "诊疗经过", "出院情况", "出院诊断", "出院医嘱", "注意事项", "出院带药", "随访计划", "医师签名",
-                        "记录医师", "记录时间", "时间");
-                break;
-            case "52923":
-                titles = Lists.newArrayList("姓名", "出生日期", "出生地", "其他", "辅助检查", "与患者关系", "性别",
-                        "年龄", "职业", "入院时间", "婚姻", "出院时间", "民族", "身份证号", "联系电话", "邮政编码",
-                        "工作单位", "联系地址", "病史提供者", "病史陈述者", "主诉", "入院情况", "入院诊断", "诊疗情况",
-                        "诊疗经过", "出院情况", "出院诊断", "出院医嘱", "注意事项", "出院带药", "随访计划", "医师签名",
-                        "记录医师", "记录时间", "时间");
-                break;
-            case "53523":
-                titles = Lists.newArrayList("姓名", "出生日期", "出生地", "其他", "辅助检查", "与患者关系", "性别",
-                        "年龄", "职业", "入院时间", "婚姻", "出院时间", "民族", "身份证号", "联系电话", "邮政编码",
-                        "工作单位", "联系地址", "病史提供者", "病史陈述者", "主诉", "入院情况", "入院诊断", "诊疗情况",
-                        "诊疗经过", "出院情况", "出院诊断", "出院医嘱", "注意事项", "出院带药", "随访计划", "医师签名",
-                        "记录医师", "记录时间", "时间");
-                break;
-        }
-        titles = CommonAnalysisUtil.sortTitles(titles, text);
-        CommonAnalysisUtil.cutByTitles(text, titles, 0, parseMap);
-        return parseMap;
-    }
-
-    private String modifyDiagKey(String text, String key) {
-        if (text.contains(key + ":")) {
-            text = text.replaceFirst("医师签名", key + "医师");
-            text = text.replaceFirst("日期", key + "时间");
-        }
-        return text;
-    }
-
 }

+ 31 - 16
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyClinicBloodEffectDocTrans.java

@@ -1,13 +1,16 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.ClinicBloodEffectDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyClinicBloodEffectXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -18,37 +21,49 @@ import java.util.Map;
  * @Author : 楼辉荣
  * @Date: 2020-04-19 17:53
  */
+@Slf4j
 public class YwzxyyClinicBloodEffectDocTrans extends ModelDocTrans {
-    private String modeId = "32";
 
     @Override
     public List<ClinicBloodEffectDoc> extract(MedrecVo medrecVo) {
         List<ClinicBloodEffectDoc> retList = Lists.newArrayList();
         List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
         contentMaps.forEach(contentMap -> {
-            retList.add(getClinicBloodEffectDoc(contentMap));
+            try {
+                ClinicBloodEffectDoc clinicBloodEffectDoc = getClinicalBloodDoc(contentMap);
+                if (clinicBloodEffectDoc != null) {
+                    retList.add(clinicBloodEffectDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         });
         return retList;
     }
 
-    private ClinicBloodEffectDoc getClinicBloodEffectDoc(Map<String, Object> contentMap) {
+    private ClinicBloodEffectDoc getClinicalBloodDoc(Map<String, Object> contentMap) {
         String content = contentMap.get("xmlText").toString();
         Map<String, String> structureMap = null;
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyClinicBloodEffectXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "32");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            ClinicBloodEffectDoc clinicBloodEffectDoc = ModelDocGenerate.clinicBloodEffectDoc(structureMap);
+            clinicBloodEffectDoc.setPageData((Map) structureMap);
+            return clinicBloodEffectDoc;
+        } else {
+            return null;
         }
-
-        ClinicBloodEffectDoc clinicBloodEffectDoc = new ClinicBloodEffectDoc();
-        clinicBloodEffectDoc.setStructureMap(structureMap);
-        clinicBloodEffectDoc.setPageData((Map) structureMap);
-
-        return clinicBloodEffectDoc;
     }
 
     private List<String> keyContrasts = Lists.newArrayList();

+ 28 - 32
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyClinicalBloodDocTrans.java

@@ -1,14 +1,15 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
-import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyClinicalBloodXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
@@ -19,15 +20,22 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/17 13:21
  */
+@Slf4j
 public class YwzxyyClinicalBloodDocTrans extends ModelDocTrans {
-    private String modeId = "10";
 
     @Override
     public List<ClinicalBloodDoc> extract(MedrecVo medrecVo) {
         List<ClinicalBloodDoc> retList = Lists.newArrayList();
         List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
         contentMaps.forEach(contentMap -> {
-            retList.add(getClinicalBloodDoc(contentMap));
+            try {
+                ClinicalBloodDoc clinicalBloodDoc = getClinicalBloodDoc(contentMap);
+                if (clinicalBloodDoc != null) {
+                    retList.add(clinicalBloodDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         });
         return retList;
     }
@@ -38,37 +46,25 @@ public class YwzxyyClinicalBloodDocTrans extends ModelDocTrans {
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyClinicalBloodXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "10");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
         }
         if (MapUtils.isNotEmpty(structureMap)) {
-            String CliBDateStr = structureMap.get("输血日期");
-            if (StringUtil.isNotBlank(CliBDateStr) && CliBDateStr.length() == 39) {
-                structureMap.put("输注开始", CliBDateStr.substring(0, 19));
-                structureMap.put("输注结束", CliBDateStr.substring(20));
-            }
+            ClinicalBloodDoc clinicalBloodDoc = ModelDocGenerate.clinicalBloodDocGen(structureMap);
+            clinicalBloodDoc.setPageData((Map) structureMap);
+            return clinicalBloodDoc;
+        } else {
+            return null;
         }
-
-        ClinicalBloodDoc clinicalBloodDoc = new ClinicalBloodDoc();
-        clinicalBloodDoc.setStructureMap(structureMap);
-        clinicalBloodDoc.setPageData((Map) structureMap);
-        return clinicalBloodDoc;
     }
 
-    private List<String> keyContrasts = Lists.newArrayList(
-            "开始时间=输注开始",
-            "医生=记录医生",
-            "记录医师=记录医生",
-            "结束时间=输注结束",
-            "内容=输注后效果评价",
-            "病程内容=病情记录",
-            "输血原因(可多选)=输注原因",
-            "ABO=血型",
-            "医师签名=记录医生",
-            "记录医师签名=记录医生"
-    );
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 31 - 18
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyCrisisValueReportDocTrans.java

@@ -1,13 +1,16 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.CrisisValueReportDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyCrisisValueReportXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -17,15 +20,22 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/19 19:41
  */
+@Slf4j
 public class YwzxyyCrisisValueReportDocTrans extends ModelDocTrans {
-    private String modeId = "23";
 
     @Override
     public List<CrisisValueReportDoc> extract(MedrecVo medrecVo) {
         List<CrisisValueReportDoc> retList = Lists.newArrayList();
         List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
         contentMaps.forEach(contentMap -> {
-            retList.add(getCrisisValueReportDoc(contentMap));
+            try {
+                CrisisValueReportDoc crisisValueReportDoc = getCrisisValueReportDoc(contentMap);
+                if (crisisValueReportDoc != null) {
+                    retList.add(crisisValueReportDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         });
         return retList;
     }
@@ -36,22 +46,25 @@ public class YwzxyyCrisisValueReportDocTrans extends ModelDocTrans {
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyCrisisValueReportXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "23");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            CrisisValueReportDoc crisisValueReportDoc = ModelDocGenerate.crisisValueReportDocGen(structureMap);
+            crisisValueReportDoc.setPageData((Map) structureMap);
+            return crisisValueReportDoc;
+        } else {
+            return null;
         }
-
-        CrisisValueReportDoc crisisValueReportDoc = new CrisisValueReportDoc();
-        crisisValueReportDoc.setStructureMap(structureMap);
-        crisisValueReportDoc.setPageData((Map) structureMap);
-
-        return crisisValueReportDoc;
     }
 
-    private List<String> keyContrasts = Lists.newArrayList(
-            "病历日期=记录时间"
-    );
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 32 - 15
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyCriticallyIllNoticeDocTrans.java

@@ -1,13 +1,17 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.CriticallyIllNoticeDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyCriticallyIllNoticeXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -17,15 +21,22 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/19 19:41
  */
+@Slf4j
 public class YwzxyyCriticallyIllNoticeDocTrans extends ModelDocTrans {
-    private String modeId = "25";
 
     @Override
     public List<CriticallyIllNoticeDoc> extract(MedrecVo medrecVo) {
         List<CriticallyIllNoticeDoc> retList = Lists.newArrayList();
         List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
         contentMaps.forEach(contentMap -> {
-            retList.add(getCriticallyIllNoticeDoc(contentMap));
+            try {
+                CriticallyIllNoticeDoc criticallyIllNoticeDoc = getCriticallyIllNoticeDoc(contentMap);
+                if (criticallyIllNoticeDoc != null) {
+                    retList.add(criticallyIllNoticeDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         });
         return retList;
     }
@@ -36,18 +47,24 @@ public class YwzxyyCriticallyIllNoticeDocTrans extends ModelDocTrans {
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyCriticallyIllNoticeXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "25");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            CriticallyIllNoticeDoc criticallyIllNoticeDoc = ModelDocGenerate.criticallyIllNoticeDocGen(structureMap);
+            criticallyIllNoticeDoc.setText(structureMap.get("原始文本"));
+            criticallyIllNoticeDoc.setPageData((Map) structureMap);
+            return criticallyIllNoticeDoc;
+        } else {
+            return null;
         }
-
-        CriticallyIllNoticeDoc criticallyIllNoticeDoc = new CriticallyIllNoticeDoc();
-        criticallyIllNoticeDoc.setStructureMap(structureMap);
-        criticallyIllNoticeDoc.setPageData((Map) structureMap);
-
-        return criticallyIllNoticeDoc;
     }
 
     private List<String> keyContrasts = Lists.newArrayList();

+ 31 - 33
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyDeathCaseDiscussDocTrans.java

@@ -1,14 +1,16 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.DeathCaseDiscussDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
-import com.lantone.qc.pub.util.MapUtil;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyDeathCaseDiscussXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -18,43 +20,39 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/17 13:22
  */
+@Slf4j
 public class YwzxyyDeathCaseDiscussDocTrans extends ModelDocTrans {
-    private String modeId = "3";
 
     @Override
     public DeathCaseDiscussDoc extract(MedrecVo medrecVo) {
-        Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
-        String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
-            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
-        } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
+        DeathCaseDiscussDoc deathCaseDiscussDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyDeathCaseDiscussXmlAnalysis();
+                Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "3");
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                }
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                deathCaseDiscussDoc = ModelDocGenerate.deathCaseDiscussDocGen(structureMap);
+                deathCaseDiscussDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
         }
-
-        MapUtil.keyAssig(structureMap, "参加讨论人员", "参加人员及职称医生", "参加人员及职称");
-        DeathCaseDiscussDoc deathCaseDiscussDoc = new DeathCaseDiscussDoc();
-        deathCaseDiscussDoc.setStructureMap(structureMap);
-        deathCaseDiscussDoc.setPageData((Map) structureMap);
-
         return deathCaseDiscussDoc;
     }
 
-    private List<String> keyContrasts = Lists.newArrayList(
-            "主持人=讨论主持人",
-            "死亡日期=死亡时间",
-            "讨论意见=讨论内容",
-            "现病史- 发病情况=入院情况",
-            "医生=记录医师",
-            "本人姓名=姓名",
-            "事件日期=讨论时间",
-            "当前诊断=死亡诊断",
-            "病历日期=记录时间",
-            "讨论小结=结论"
-    );
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 32 - 29
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyDeathRecordDocTrans.java

@@ -1,13 +1,16 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.DeathRecordDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyDeathRecordXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -17,40 +20,40 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/17 13:23
  */
+@Slf4j
 public class YwzxyyDeathRecordDocTrans extends ModelDocTrans {
-    private String modeId = "24";
 
     @Override
     public DeathRecordDoc extract(MedrecVo medrecVo) {
-        Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
-        String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
-            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
-        } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
+        DeathRecordDoc deathRecordDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyDeathRecordXmlAnalysis();
+                Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "24");
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                }
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                deathRecordDoc = ModelDocGenerate.deathRecordDocGen(structureMap);
+                deathRecordDoc.setText(structureMap.get("原始文本"));
+                deathRecordDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
         }
-
-        DeathRecordDoc deathRecordDoc = new DeathRecordDoc();
-        deathRecordDoc.setStructureMap(structureMap);
-        deathRecordDoc.setPageData((Map) structureMap);
-
         return deathRecordDoc;
     }
 
-    private List<String> keyContrasts = Lists.newArrayList(
-            "当前诊断=死亡诊断",
-            "死亡日期=死亡时间",
-            "初步诊断=入院诊断",
-            "诊治经过=诊疗经过",
-            "本人姓名=姓名",
-            "现病史- 发病情况=发病情况",
-            "病历日期=记录时间",
-            "医生=记录医师"
-    );
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 31 - 32
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyDifficultCaseDiscussDocTrans.java

@@ -1,13 +1,16 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.DifficultCaseDiscussDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyDifficultCaseDiscussXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -17,15 +20,22 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/17 13:23
  */
+@Slf4j
 public class YwzxyyDifficultCaseDiscussDocTrans extends ModelDocTrans {
-    private String modeId = "19";
 
     @Override
     public List<DifficultCaseDiscussDoc> extract(MedrecVo medrecVo) {
         List<DifficultCaseDiscussDoc> retList = Lists.newArrayList();
         List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
         contentMaps.forEach(contentMap -> {
-            retList.add(getDifficultCaseDiscussDoc(contentMap));
+            try {
+                DifficultCaseDiscussDoc difficultCaseDiscussDoc = getDifficultCaseDiscussDoc(contentMap);
+                if (difficultCaseDiscussDoc != null) {
+                    retList.add(difficultCaseDiscussDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         });
         return retList;
     }
@@ -36,36 +46,25 @@ public class YwzxyyDifficultCaseDiscussDocTrans extends ModelDocTrans {
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            List<String> titles =Lists.newArrayList("记录人","主持人");
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyDifficultCaseDiscussXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "19");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        if (MapUtils.isNotEmpty(structureMap)) {
+            DifficultCaseDiscussDoc difficultCaseDiscussDoc = ModelDocGenerate.difficultCaseDiscussDocGen(structureMap);
+            difficultCaseDiscussDoc.setPageData((Map) structureMap);
+            return difficultCaseDiscussDoc;
+        } else {
+            return null;
         }
-
-        DifficultCaseDiscussDoc difficultCaseDiscussDoc = new DifficultCaseDiscussDoc();
-        difficultCaseDiscussDoc.setStructureMap(structureMap);
-        difficultCaseDiscussDoc.setPageData((Map) structureMap);
-
-        return difficultCaseDiscussDoc;
     }
 
-    private List<String> keyContrasts = Lists.newArrayList(
-            "医生=记录者",
-            "讨论小结=主持人小结",
-            "讨论意见=具体讨论意见",
-            "讨论日期时间=讨论日期",
-            "本人姓名=姓名",
-            "参加人员及职称(护士)=参加人员的姓名及专业技术职务",
-            "患者姓名=姓名",
-            "性别代码=性别",
-            "年龄 (岁)=年龄",
-            "当前科室=科别",
-            "主持人姓名=主持人姓名及专业技术职务",
-            "参加讨论人员名单=参加人员的姓名及专业技术职务",
-            "讨论内容=具体讨论意见",
-            "讨论时间=讨论日期"
-    );
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 38 - 131
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyFirstCourseRecordDocTrans.java

@@ -2,20 +2,17 @@ package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
-import com.lantone.qc.pub.util.MapUtil;
 import com.lantone.qc.trans.ModelDocTrans;
-import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
 import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
-import org.apache.commons.lang3.StringUtils;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyFirstCourseRecordXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
-import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -26,140 +23,50 @@ import static com.lantone.qc.trans.comsis.ModelDocGenerate.structureMapJoin;
  * @author: rengb
  * @time: 2020/3/17 13:25
  */
+@Slf4j
 public class YwzxyyFirstCourseRecordDocTrans extends ModelDocTrans {
-    private String modeId = "2";
 
     @Override
     public FirstCourseRecordDoc extract(MedrecVo medrecVo) {
-        Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
-        String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
-            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
-        } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            List<String> titles = Lists.newArrayList("病历记录时间", "一般情况", "一、病例特点", "二、初步诊断", "三、诊断依据"
-                    , "四、鉴别诊断", "五、诊疗计划", "主诊医师", "记录医师", "审核医师");
-            String text = sourceMap.get("原始文本");
-            titles = CommonAnalysisUtil.sortTitles(titles, text);
-            CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
-            //新生儿科特殊处理
-            if (StringUtils.isNotEmpty(sourceMap.get("病历记录时间")) && sourceMap.get("病历记录时间").split("患者").length > 1) {
-                sourceMap.put("病历内容", "患者" + sourceMap.get("病历记录时间").split("患者")[1]);
-            }
-            Map<String, String> changeKeyMap = Maps.newHashMap();
-            Iterator<Map.Entry<String, String>> it = sourceMap.entrySet().iterator();
-            while (it.hasNext()) {
-                Map.Entry<String, String> entry = it.next();
-                if (entry.getKey().contains("、")) {
-                    changeKeyMap.put(entry.getKey().split("、")[1], sourceMap.get(entry.getKey()));
-                    it.remove();
-                }
-            }
-            sourceMap.putAll(changeKeyMap);
-
-
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
-        }
-        /*
-        // 最后的主诊医师处理
-        //经主诊医师XXX同意后确定以下诊疗计划:......
-        //......。以下诊疗方案由主诊医师/诊疗组长XXX确认
-        if (StringUtils.isNotEmpty(structureMap.get("诊疗计划"))) {
-            if (structureMap.get("诊疗计划").contains("诊疗方案") || structureMap.get("诊疗计划").contains("诊疗规范")) {
-                String temp = structureMap.get("诊疗计划");
-                List<String> titles = Lists.newArrayList("。", ";");
-                for (String str : titles) {
-                    String[] s = temp.split(str);
-                    temp = s[s.length - 1];
-                }
-                List<String> titles1 = Lists.newArrayList("方案", "由", "组长", "医师", "主诊", "诊疗", "确认", "审核", "医生", "规范", "以上", "经", "审核", "、", "同意", "1", "2", "3", "4", "副主任");
-                for (String str : titles1) {
-                    temp = temp.replaceAll(str, "");
+        FirstCourseRecordDoc firstCourseRecordDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyFirstCourseRecordXmlAnalysis();
+                Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    sourceMap = removeSerialNumber(sourceMap);
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "2");
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
                 }
-                structureMap.put("主诊医师", temp);
-                structureMap.put("诊疗计划", structureMap.get("诊疗计划").split("诊疗方案")[0]);
             }
-            if (structureMap.get("诊疗计划").contains("诊疗计划") || structureMap.get("诊疗计划").contains("治疗计划")) {
-                String temp = structureMap.get("诊疗计划");
-                List<String> titles = Lists.newArrayList("。", ";", ":");
-                for (String str : titles) {
-                    String[] s = temp.split(str);
-                    temp = s[0];
-                }
-                List<String> titles1 = Lists.newArrayList("经", "主诊", "同意", "医师", "确定", "以下", "诊疗计划", "后", "如下", "审核", "治疗计划", "医", "确认", ",");
-                for (String str : titles1) {
-                    temp = temp.replaceAll(str, "");
-                }
-                structureMap.put("主诊医师", temp);
-                if (structureMap.get("诊疗计划").split("1").length > 1) {
-                    structureMap.put("诊疗计划", "1" + structureMap.get("诊疗计划").split("1")[1]);
-                }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                firstCourseRecordDoc = ModelDocGenerate.firstCourseRecordDocGen(structureMap);
+                firstCourseRecordDoc.setText(structureMap.get("原始文本"));
+                firstCourseRecordDoc.setPageData((Map) structureMap);
+                List<String> keys = Lists.newArrayList("诊疗计划");
+                String treatPlanJoin = structureMapJoin(structureMap, keys);
+                firstCourseRecordDoc.getTreatPlanLabel().setAiText(treatPlanJoin);
             }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
         }
-
-         */
-        // 病例特点=主诉+现病史-发病情况+专科检查+实验室检查+影像学检查+辅助检查结果+呼吸+脉搏+体温+血压
-        //        structureMap.put("病例特点", MapUtil.getSelectString(structureMap, Arrays.asList(
-        //                "主诉",
-        //                "现病史-发病情况",
-        //                "专科检查",
-        //                "实验室检查",
-        //                "影像学检查",
-        //                "辅助检查结果",
-        //                "呼吸",
-        //                "脉搏",
-        //                "体温",
-        //                "血压"
-        //                ))
-        //        );
-        // 诊断依据=性别+年龄+主诉+现病史-发病情况+专科检查+实验室检查+影像学检查+辅助检查结果+呼吸+脉搏+体温+血压
-        //        structureMap.put("诊断依据", MapUtil.getSelectString(structureMap, Arrays.asList(
-        //                "性别",
-        //                "年龄",
-        //                "主诉",
-        //                "现病史-发病情况",
-        //                "专科检查",
-        //                "实验室检查",
-        //                "影像学检查",
-        //                "辅助检查结果",
-        //                "呼吸",
-        //                "脉搏",
-        //                "体温",
-        //                "血压"
-        //                ))
-        //        );
-        // 诊疗计划=检查计划+治疗计划和措施
-        structureMap.put("诊疗计划-crf", MapUtil.getSelectString(structureMap, Arrays.asList(
-                "检查计划",
-                "治疗计划和措施"
-                ))
-        );
-
-        // 诊疗计划
-        FirstCourseRecordDoc firstCourseRecordDoc = ModelDocGenerate.firstCourseRecordDocGen(structureMap);
-        firstCourseRecordDoc.setPageData((Map) structureMap);
-        List<String> keys = Lists.newArrayList("检查计划", "治疗计划", "诊疗计划");
-        String treatPlanJoin = structureMapJoin(structureMap, keys);
-        firstCourseRecordDoc.getTreatPlanLabel().setAiText(treatPlanJoin);
         return firstCourseRecordDoc;
     }
 
-    private List<String> keyContrasts = Lists.newArrayList(
-            "本人姓名=姓名",
-            "现病史- 发病情况=现病史",
-            "现病史- 发病情况=现病史",
-            "医生=记录医生",
-            "治疗计划和措施=治疗计划",
-            "体温(耳)=体温耳",
-            "体温(口)=体温口",
-            "病程时间=病历日期",
-            "记录医师=记录医生",
-            "病例日期=病历日期",
-            "一般情况=病历内容"
-    );
+    private Map<String, String> removeSerialNumber(Map<String, String> sourceMap) {
+        Map<String, String> structureMap = Maps.newLinkedHashMap();
+        sourceMap.forEach((key, value) -> structureMap.put(key.replaceAll("[一二三四五六()().123456]", ""), value));
+        return structureMap;
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 54 - 53
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyLeaveHospitalDocTrans.java

@@ -1,16 +1,18 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.label.LeaveHospitalDoctorAdviceLabel;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
-import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
 import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyLeaveHospitalXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import java.util.List;
@@ -21,67 +23,66 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/17 13:25
  */
+@Slf4j
 public class YwzxyyLeaveHospitalDocTrans extends ModelDocTrans {
-    private String modeId = "5";
 
     @Override
     public LeaveHospitalDoc extract(MedrecVo medrecVo) {
-        Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
-        String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
-            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
-        } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            List<String> titles = Lists.newArrayList("入院时间", "出院时间", "住院数", "住院天数", "入院诊断", "出院诊断", "出院诊断"
-                    , "入院情况", "住院经过", "出院情况", "出院医嘱", "医师签名", "签名时间", "主诉", "诊疗过程", "医师签名时间");
-            String text = sourceMap.get("原始文本");
-            List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
-            CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
+        LeaveHospitalDoc leaveHospitalDoc = null;
+        try {
+            Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
+            String content = contentMap.get("xmlText").toString();
+            Map<String, String> structureMap = null;
+            if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
+                structureMap = (Map) FastJsonUtils.getJsonToMap(content);
+            } else {
+                String recTitle = contentMap.get("recTitle").toString();
+                String recTypeId = contentMap.get("recTypeId").toString();
+                YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyLeaveHospitalXmlAnalysis();
+                Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+                if (MapUtils.isNotEmpty(sourceMap)) {
+                    structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "5");
+                    structureMap.put("记录编号", contentMap.get("recId").toString());
+                    structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+                }
+            }
+            if (MapUtils.isNotEmpty(structureMap)) {
+                leaveHospitalDoc = ModelDocGenerate.leaveHospitalDocGen(structureMap);
+                if (StringUtils.isNotEmpty(structureMap.get("出院医嘱"))) {
+                    LeaveHospitalDoctorAdviceLabel leaveHospitalDoctorAdviceLabel = new LeaveHospitalDoctorAdviceLabel();
+                    leaveHospitalDoctorAdviceLabel.setText(structureMap.get("出院医嘱"));
+                    leaveHospitalDoctorAdviceLabel.setAiText(structureMap.get("出院医嘱"));
+                    leaveHospitalDoc.setLeaveHospitalDoctorAdviceLabel(leaveHospitalDoctorAdviceLabel);
+                }
+                leaveHospitalDoc.setText(CommonAnalysisUtil.html2String(content));
+                leaveHospitalDoc.setPageData((Map) structureMap);
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
         }
-        LeaveHospitalDoc leaveHospitalDoc = new LeaveHospitalDoc();
-        leaveHospitalDoc.setStructureMap(structureMap);
-        leaveHospitalDoc.setPageData((Map) structureMap);
-        if (StringUtil.isNotEmpty(structureMap.get("原始文本"))) {
-            leaveHospitalDoc.setText(structureMap.get("原始文本"));
-        }
-        if (structureMap.containsKey("记录医生") && "记录医师".equals(structureMap.get("记录医生"))) {
-            structureMap.put("记录医生", "");
-        }
-        if (StringUtils.isNotEmpty(structureMap.get("出院医嘱"))) {
-            LeaveHospitalDoctorAdviceLabel leaveHospitalDoctorAdviceLabel = new LeaveHospitalDoctorAdviceLabel();
-            leaveHospitalDoctorAdviceLabel.setText(structureMap.get("出院医嘱"));
-            leaveHospitalDoctorAdviceLabel.setAiText(structureMap.get("出院医嘱"));
-            leaveHospitalDoc.setLeaveHospitalDoctorAdviceLabel(leaveHospitalDoctorAdviceLabel);
-        }
-
         return leaveHospitalDoc;
     }
 
     private List<String> keyContrasts = Lists.newArrayList(
-            "本人姓名=姓名",
+            "患者姓名=姓名",
+            "性别=",
+            "床号=",
+            "年龄=",
+            "科室=科别",
+            "入院诊断=入院诊断",
+            "出院诊断=出院诊断",
             "实际住院天数=住院天数",
-            "出院时情况=出院情况",
-            //            "注意事项=健康教育",
-            "复诊时间=随访计划",
-            "出院指导=健康教育",
-            "医生=记录医生",
-            "医师签名=记录医生",
-            "病历日期=记录时间",
-            "体温(耳)=体温耳",
-            "主诉=入院情况",
-            "诊疗过程=诊治经过",
-            "医师签名时间=记录时间",
-            "出院时间=出院日期",
-            "初步诊断=入院诊断",
-            "住院经过=诊治经过",
-            "患者签名日期=记录时间",
+            "入院情况=入院情况",
+            "诊疗经过=诊治经过",
+            "出院情况=",
+            "出院医嘱=",
+            "随访计划=",
             "医师签名=记录医生",
-            "签名时间=记录时间"
+            "时间=记录时间",
+            "治疗结果=诊疗结果",
+            "其它=其他",
+            "出生年月=出生日期",
+            "床位=床号"
     );
 
 }

+ 98 - 326
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyOperationDocTrans.java

@@ -3,8 +3,6 @@ package com.lantone.qc.trans.ywzxyy;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationInformedConsentDoc;
@@ -16,9 +14,14 @@ import com.lantone.qc.pub.util.FastJsonUtils;
 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.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
-import org.apache.commons.lang3.StringUtils;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyOperationDiscussionXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyOperationRecordXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyPreoperativeDiscussionXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -29,14 +32,9 @@ import java.util.Set;
  * @author: rengb
  * @time: 2020/3/20 17:11
  */
+@Slf4j
 public class YwzxyyOperationDocTrans extends ModelDocTrans {
 
-    /**
-     * 手术文档包含:术后首次病程及谈话记录;手术记录;术前讨论、术前小结;手术知情同意书;手术安全核查表
-     *
-     * @param medrecVo
-     * @return
-     */
     @Override
     public List<OperationDoc> extract(MedrecVo medrecVo) {
         List<OperationDoc> retList = Lists.newArrayList();
@@ -50,14 +48,12 @@ public class YwzxyyOperationDocTrans extends ModelDocTrans {
         Map<String, OperationRecordDoc> operationRecordDocMap = getOperationRecordDocMap((List) contentMap.get("手术记录"));
         Map<String, PreoperativeDiscussionDoc> preoperativeDiscussionDocMap = getPreoperativeDiscussionDocMap((List) contentMap.get("术前讨论、术前小结"));
         Map<String, OperationInformedConsentDoc> operationInformedConsentDocMap = getOperationInformedConsentDocMap((List) contentMap.get("手术知情同意书"));
-        //Map<String, OperationSafetyChecklistDoc> operationSafetyChecklistDocMap = getOperationSafetyChecklistDocMap((List) contentMap.get("手术安全核查表"));
+        Map<String, OperationSafetyChecklistDoc> operationSafetyChecklistDocMap = getOperationSafetyChecklistDocMap((List) contentMap.get("手术安全核查表"));
 
         Set<String> operationNameSet = Sets.newHashSet();
         operationNameSet.addAll(operationDiscussionDocMap.keySet());
         operationNameSet.addAll(operationRecordDocMap.keySet());
         operationNameSet.addAll(preoperativeDiscussionDocMap.keySet());
-        operationNameSet.addAll(operationInformedConsentDocMap.keySet());
-        //operationNameSet.addAll(operationSafetyChecklistDocMap.keySet());
 
         operationNameSet.forEach(operationName -> {
             OperationDoc operationDoc = new OperationDoc();
@@ -66,9 +62,10 @@ public class YwzxyyOperationDocTrans extends ModelDocTrans {
             operationDoc.setOperationRecordDoc(operationRecordDocMap.get(operationName));
             operationDoc.setPreoperativeDiscussionDoc(preoperativeDiscussionDocMap.get(operationName));
             operationDoc.setOperationInformedConsentDoc(operationInformedConsentDocMap.get(operationName));
-            //operationDoc.setOperationSafetyChecklistDoc(operationSafetyChecklistDocMap.get(operationName));
+            operationDoc.setOperationSafetyChecklistDoc(operationSafetyChecklistDocMap.get(operationName));
             retList.add(operationDoc);
         });
+
         return retList;
     }
 
@@ -85,78 +82,48 @@ public class YwzxyyOperationDocTrans extends ModelDocTrans {
             if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
                 continue;
             }
-            operationName = index + "";
-            OperationDiscussionDoc operationDiscussionDoc = getOperationDiscussionDoc(contentMap);
-            operationDiscussionDoc.setOperationName(operationName);
-            retMap.put(operationName, operationDiscussionDoc);
-            index++;
+            try {
+                OperationDiscussionDoc operationDiscussionDoc = getOperationDiscussionDoc(contentMap);
+                if (operationDiscussionDoc != null) {
+                    operationName = index + "";
+                    operationDiscussionDoc.setOperationName(operationName);
+                    retMap.put(operationName, operationDiscussionDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         }
         return retMap;
     }
 
     private OperationDiscussionDoc getOperationDiscussionDoc(Map<String, Object> contentMap) {
-        String modeId = "18";
         String content = contentMap.get("xmlText").toString();
         Map<String, String> structureMap = null;
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            List<String> titles = Lists.newArrayList("手术开始时间", "术中诊断", "麻醉方式", "手术方式",
-                    "手术简要经过(包括术中所见)", "术后诊疗计划(处理措施)", "术后注意观察事项", "医师签名",
-                    "签名时间", "患者或代理人签名", "签名时间", "术中见", "术后诊断", "术后谈话");
-            String text = sourceMap.get("原始文本");
-            List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
-            CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            int index = 0;
-            if (text.contains("手术开始时间")) {
-                index = text.indexOf("手术开始时间") + 8;
-            }
-            String timevalue = text.substring(index, index + 18);
-            sourceMap.put("手术开始时间", timevalue);
-            String[] str = new String[3];
-            String s = "";
-            if (text.contains("术中诊断")) {
-                str = text.split("术中诊断");
-                s = str[1].replace(":", "");
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyOperationDiscussionXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationDiscussion_keyContrasts, "18");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
             }
-            sourceMap.put("术中诊断", s);
-
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationDiscussion_keyContrasts, modeId);
-
         }
-
-        OperationDiscussionDoc operationDiscussionDoc = new OperationDiscussionDoc();
-        operationDiscussionDoc.setStructureMap(structureMap);
-        operationDiscussionDoc.setPageData((Map) structureMap);
-
-        return operationDiscussionDoc;
+        if (MapUtils.isNotEmpty(structureMap)) {
+            OperationDiscussionDoc operationDiscussionDoc = ModelDocGenerate.operationDiscussionDocGen(structureMap);
+            operationDiscussionDoc.setText(structureMap.get("原始文本"));
+            operationDiscussionDoc.setPageData((Map) structureMap);
+            return operationDiscussionDoc;
+        } else {
+            return null;
+        }
     }
 
-    private List<String> operationDiscussion_keyContrasts = Lists.newArrayList(
-            "本人姓名=姓名",
-            "书写日期=记录时间",
-            "注意事项=术后注意事项",
-            "治疗计划和措施=术后处理措施",
-            "术后注意观察事项=术后注意事项",
-            "手术方式=手术名称方式",
-            "手术简要经过(包括术中所见)=手术简要经过",
-            "术中诊断=术中后诊断",
-            "术后诊疗计划(处理措施)=术后处理措施",
-            "手术开始时间=开始时间",
-            "病程内容=手术简要经过",
-            "术后诊断=术后处理措施",
-            "术后谈话=术后注意事项",
-            "记录医师签名=记录医生",
-            "医师签名=记录医生",
-            "签名时间=记录时间",
-            "会诊日期=手术日期",
-            "记录医师=记录医生",
-            "医师签名日期=记录时间"
-    );
+    private List<String> operationDiscussion_keyContrasts = Lists.newArrayList();
 
 
     /**********************************************手术记录*************************************************************/
@@ -171,94 +138,48 @@ public class YwzxyyOperationDocTrans extends ModelDocTrans {
             if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
                 continue;
             }
-            operationName = index + "";
-            OperationRecordDoc operationRecordDoc = getOperationRecordDoc(contentMap);
-            operationRecordDoc.setOperationName(operationName);
-            retMap.put(operationName, operationRecordDoc);
-            index++;
+            try {
+                OperationRecordDoc operationRecordDoc = getOperationRecordDoc(contentMap);
+                if (operationRecordDoc != null) {
+                    operationName = index + "";
+                    operationRecordDoc.setOperationName(operationName);
+                    retMap.put(operationName, operationRecordDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         }
         return retMap;
     }
 
     private OperationRecordDoc getOperationRecordDoc(Map<String, Object> contentMap) {
-        String modeId = "17";
         String content = contentMap.get("xmlText").toString();
         Map<String, String> structureMap = null;
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            List<String> titles = Lists.newArrayList("手术开始时间", "手术结束时间", "手术时间", "手术前诊断", "术(中)后诊断",
-                    "手术名称", "手术医师", "助手医师", "第一助手", "第二助手","第三助手","洗手护士", "麻醉方式", "手术人员", "麻醉人员",
-                    "麻醉医师", "手术护士", "巡回护士", "手术中用药(化疗等药物)", "手术切口类别(可选)", "术中出血量", "输血量", "术中输血量"
-                    , "围术期并发症", "手术切除标本", "冰冻切片结果", "标本件数", "是否有植入物", "手术步骤", "记录者签名", "记录日期", "术中失血量",
-                    "手术简要经过(包括“术中所见”)", "医师签名", "签名时间", "患者或代理人签名", "术中并发症", "日    期", "术前诊断", "术后诊断","手术经过",
-                    "手术适应症","手术记录人员","ml");
-
-            String text = sourceMap.get("原始文本");
-            List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
-            CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationRecord_keyContrasts, modeId);
-            //出血量、输血量有些有ml有些没有,统一一下
-            if(structureMap.containsKey("输血量")){
-                structureMap.put("输血量",structureMap.get("输血量").replaceAll("ml",""));
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyOperationRecordXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationRecord_keyContrasts, "17");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
             }
-            OrdinaryAssistant.removeBlank(structureMap);
         }
-        OperationRecordDoc operationRecordDoc = new OperationRecordDoc();
-        operationRecordDoc.setStructureMap(structureMap);
-        operationRecordDoc.setPageData((Map) structureMap);
-        return operationRecordDoc;
+        if (MapUtils.isNotEmpty(structureMap)) {
+            OperationRecordDoc operationRecordDoc = ModelDocGenerate.operationRecordDocGen(structureMap);
+            operationRecordDoc.setText(structureMap.get("原始文本"));
+            operationRecordDoc.setPageData((Map) structureMap);
+            return operationRecordDoc;
+        } else {
+            return null;
+        }
     }
 
-    // 手术记录
-    private List<String> operationRecord_keyContrasts = Lists.newArrayList(
-            /*"结束时间=手术结束时间",
-            "开始时间=手术开始时间",*/
-            "医生=主刀医师签名",
-            "助手=一助",
-            "本人姓名=姓名",
-            "手术开始日期时间=开始时间",
-            "手术结束日期时间=结束时间",
-            "术后诊断=术中后诊断",
-            "麻醉方法代码=麻醉方式",
-            "麻醉医师签名=麻醉医师",
-            "手术过程的详细描述=手术经过及处理",
-            "手术开始时间=开始时间",
-            "手术结束时间=结束时间",
-            "手术中用药=手术中用药化疗等药物",
-            "术后送检病理无有标本件数=标本件数",
-            "出血量=出血",
-            "是否有植入物=是否术中植入物",
-            "手术切口类别(可选)=切口类别",
-            "手术步骤=手术经过及处理",
-            "记录者签名=记录医生",
-            "记录日期=记录时间",
-            "手术人员=主刀医师",
-            "手术医师=主刀医师",
-            "失血量=出血",
-            "术中失血量=出血",
-            "医师签名时间=记录时间",
-            "医师签名=记录医生",
-            "手术过程=手术经过及处理",
-            "手术简要经过(包括“术中所见”)=手术经过及处理",
-            "第一助手=一助",
-            "洗手护士=手术护士",
-            "手术经过=手术经过及处理",
-            "助手医师=一助",
-            "主治医师=主刀医师",
-            "术中出血量=出血",
-            "初步诊断=术前诊断",
-            "手术经过=手术经过及处理",
-            "助手=一助",
-            "手术前诊断=术前诊断",
-            "手术记录人员=记录医生",
-            "签名时间=记录时间"
-
-    );
+    private List<String> operationRecord_keyContrasts = Lists.newArrayList();
 
 
     /**********************************************术前讨论、术前小结****************************************************/
@@ -273,133 +194,49 @@ public class YwzxyyOperationDocTrans extends ModelDocTrans {
             if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
                 continue;
             }
-            operationName = index + "";
-            PreoperativeDiscussionDoc preoperativeDiscussionDoc = getPreoperativeDiscussionDoc(contentMap);
-            preoperativeDiscussionDoc.setOperationName(operationName);
-            retMap.put(operationName, preoperativeDiscussionDoc);
-            index++;
+            try {
+                PreoperativeDiscussionDoc preoperativeDiscussionDoc = getPreoperativeDiscussionDoc(contentMap);
+                if (preoperativeDiscussionDoc != null) {
+                    operationName = index + "";
+                    preoperativeDiscussionDoc.setOperationName(operationName);
+                    retMap.put(operationName, preoperativeDiscussionDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         }
         return retMap;
     }
 
     private PreoperativeDiscussionDoc getPreoperativeDiscussionDoc(Map<String, Object> contentMap) {
-        String modeId = "11";
         String content = contentMap.get("xmlText").toString();
         Map<String, String> structureMap = null;
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            List<String> titles = Lists.newArrayList("讨论时间", "讨论地点", "主持人", "经治医师", "讨论意见",
-                    "参加人员及技术职称", "讨论方式", "讨论记录", "主持人签名", "记录人签名", "病史摘要", "术前诊断", "术前准备"
-                    , "拟施手术", "拟施麻醉", "术中注意点", "家属谈话内容", "医生签名", "日  期", "术前准备情况", "手术指征", "手术方案",
-                    "可能出现的意外及防范措施", "讨论日期时间", "参加人员", "讨论主持人", "小结", "记录医师","手术者签名","麻醉医师签名","手术指征与禁忌症"
-                    , "拟施手术名称和方式及可能的变更", "可替代方案", "计划性多次手术",
-                    "术前特殊准备", "心理状态", "经济评估", "主要术中、术后风险及防范措施", "术中、术后注意事项(含护理事项)",
-                    "一:经治医师汇报病史", "二:讨论目的", "三:讨论","主持人的姓名及专业技术职务","参加讨论者的姓名及专业技术职务","记录医师签名",
-                    "手术预期","注意事项","防范措施","拟实施麻醉方式","手术时间","医师签名","会诊意见","患者术前情况");
-            String text = sourceMap.get("原始文本");
-            List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
-            CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            if(sourceMap.containsKey("术前诊断")){
-                String[] str=sourceMap.get("术前诊断").split("术前准备");
-                if(str.length>1){
-                    sourceMap.put("术前准备",str[1]);
-                    sourceMap.put("术前诊断",str[0]);
-                }
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyPreoperativeDiscussionXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, preoperativeDiscussion_keyContrasts, "11");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
             }
-            if(sourceMap.containsKey("术前准备情况")){
-                if(sourceMap.get("原始文本").split("术前准备情况").length>1){
-                    sourceMap.put("术前准备情况",sourceMap.get("原始文本").split("术前准备情况")[1].split("手术指征")[0].split("拟实施麻醉方式")[0]);
-                }
-            }
-            if(sourceMap.containsKey("计划性多次手术")){
-                sourceMap.put("计划性多次手术",sourceMap.get("计划性多次手术").split("拟施麻醉方式")[0]);
-            }
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, preoperativeDiscussion_keyContrasts, modeId);
-            //去除list中key对应的value中末尾的数字字符
-            List<String> title = Lists.newArrayList("术前诊断","手术指征与禁忌","拟施手术方式名称及可能的变更与禁忌症",
-                    "可替代方案","计划性多次手术","主要术中、术后风险及防范措施","心理状态","经济评估","手术预期","注意事项","防范措施","讨论意见");
-            for (String str:title) {
-                if(structureMap.containsKey(str)){
-                    String orign=structureMap.get(str).replaceAll("\\.","");
-                    String discarded=(orign+"1").replaceAll(".*[^\\d](?=(\\d+))","");
-                    String value=(orign+"1").replaceAll(discarded,"");
-                    structureMap.put(str,value);
-                }
-            }
-            addKeyMapping(structureMap, "麻醉方式", "拟施手术名称及麻醉方式");
-            addKeyMapping(structureMap, "主刀医师签名", "主刀医生");
-            addKeyMapping(structureMap, "既往疾病史", "其他");
-            addKeyMapping(structureMap, "诊疗计划", "治疗计划和措施");
         }
-        PreoperativeDiscussionDoc preoperativeDiscussionDoc = new PreoperativeDiscussionDoc();
-        preoperativeDiscussionDoc.setStructureMap(structureMap);
-        preoperativeDiscussionDoc.setPageData((Map) structureMap);
-        return preoperativeDiscussionDoc;
+        if (MapUtils.isNotEmpty(structureMap)) {
+            PreoperativeDiscussionDoc preoperativeDiscussionDoc = ModelDocGenerate.preoperativeDiscussionDocGen(structureMap);
+            preoperativeDiscussionDoc.setText(structureMap.get("原始文本"));
+            preoperativeDiscussionDoc.setPageData((Map) structureMap);
+            return preoperativeDiscussionDoc;
+        } else {
+            return null;
+        }
     }
 
-    private List<String> preoperativeDiscussion_keyContrasts = Lists.newArrayList(
-            "参加人员及职称=参加人员",
-            "主刀医师=主刀医师签名",
-            "注意事项=术前术后注意事项",
-            "其他术前相关情况=术前术后注意事项",
-            "辅助检查结果=辅助检查",
-            "术中、术后防范措施=主要术中、术后风险及防范措施",
-            "术中注意点=主要术中、术后风险及防范措施",
-            "现病史- 发病情况=发病经过",
-            "本人姓名=姓名",
-            "拟施手术名称和方式=拟施手术方式名称及可能的变更与禁忌症",
-            "拟施手术=拟施手术方式名称及可能的变更与禁忌症",
-            "拟实施麻醉方法代码=拟施麻醉方式",
-            "拟施麻醉=拟施麻醉方式",
-            "拟实施手术及操作名称=拟施手术方式、名称及可能的变更与禁忌症",
-            "术前术后注意事项=主要术中、术后风险及防范措施",
-            "时间=讨论时间",
-            "手术指征与禁忌症=手术指征与禁忌",
-            "讨论日期时间=讨论时间",
-            "讨论日期=讨论时间",
-            "参加人员及技术职称=参加人员",
-            "主持人姓名=讨论主持人",
-            "术前准备内容=术前准备",
-            "经治医师=经治医生",
-            "记录人签名=记录医生",
-            "医生签名=记录医生",
-            "讨论记录=讨论意见",
-            "记录医师=记录医生",
-            "讨论日期时间=讨论时间",
-            "可能出现的意外及防范措施=主要术中、术后风险及防范措施",
-            "术前准备情况=术前准备",
-            "手术指征=手术指征与禁忌",
-            "手术方案=拟施手术方式名称及可能的变更与禁忌症",
-            "主持人=讨论主持人",
-            "小结=主持人小结",
-            "术前特殊准备=术前准备",
-            "参加讨论人员名单=参加人员",
-            "患者姓名=患者",
-            "当前床号=床号",
-            "当前科室=科别",
-            "一:经治医师汇报病史=经治医师汇报病史",
-            "二:讨论目的=讨论目的",
-            "三:讨论=讨论",
-            "患者签名日期=记录时间",
-            "手术名称=拟施手术方式名称及可能的变更与禁忌症",
-            "麻醉方式=拟施麻醉方式",
-            "拟施手术名称和方式及可能的变更=拟施手术方式名称及可能的变更与禁忌症",
-            "手术要点=主要术中、术后风险及防范措施",
-            "参加讨论者的姓名及专业技术职务=参加人员",
-            "主持人的姓名及专业技术职务=讨论主持人",
-            "病史摘要=简要病情",
-            "医师签名=记录医生",
-            "注意事项=术中术后注意事项含护理事项",
-            "防范措施=主要术中、术后风险及防范措施",
-            "医师签名时间=记录时间",
-            "医师签名=记录医生",
-            "会诊意见=讨论意见"
-    );
+    private List<String> preoperativeDiscussion_keyContrasts = Lists.newArrayList();
+
 
     /**********************************************手术知情同意书****************************************************/
     private Map<String, OperationInformedConsentDoc> getOperationInformedConsentDocMap(List<Map<String, Object>> contentMaps) {
@@ -423,41 +260,11 @@ public class YwzxyyOperationDocTrans extends ModelDocTrans {
     }
 
     private OperationInformedConsentDoc getOperationInformedConsentDoc(Map<String, Object> contentMap) {
-        String modeId = "16";
-        String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
-            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
-        } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationInformedConsent_keyContrasts, modeId);
-        }
         OperationInformedConsentDoc operationInformedConsentDoc = new OperationInformedConsentDoc();
-        operationInformedConsentDoc.setStructureMap(structureMap);
-        operationInformedConsentDoc.setPageData((Map) structureMap);
         return operationInformedConsentDoc;
     }
 
-    private List<String> operationInformedConsent_keyContrasts = Lists.newArrayList(
-            "姓名++++患者姓名=姓名",
-            "性别=",
-            "病区++++病区名称=病区",
-            "床号=",
-            "病案号++++住院号=病案号",
-            "手术医生=",
-            "目前诊断=",
-            "手术名称=",
-            "手术指征=手术指征与禁忌",
-            "风险及并发症=",
-            "++++保守治疗=保守治疗",
-            "++++其他手术=其他手术",
-            "签名++++=签名",
-            "签名时间=签名时间",
-            "术前准备内容=术前准备"
-    );
+    private List<String> operationInformedConsent_keyContrasts = Lists.newArrayList();
 
 
     /**********************************************手术安全核查表****************************************************/
@@ -482,45 +289,10 @@ public class YwzxyyOperationDocTrans extends ModelDocTrans {
     }
 
     private OperationSafetyChecklistDoc getOperationSafetyChecklistDoc(Map<String, Object> contentMap) {
-        String modeId = "21";
-        String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
-            structureMap = (Map) FastJsonUtils.getJsonToMap(content);
-        } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationSafetyChecklist_keyContrasts, modeId);
-        }
         OperationSafetyChecklistDoc operationSafetyChecklistDoc = new OperationSafetyChecklistDoc();
-        operationSafetyChecklistDoc.setStructureMap(structureMap);
-        operationSafetyChecklistDoc.setPageData((Map) structureMap);
-
         return operationSafetyChecklistDoc;
     }
 
-    private List<String> operationSafetyChecklist_keyContrasts = Lists.newArrayList(
-            "姓名++++患者姓名=姓名",
-            "性别",
-            "病区",
-            "床号",
-            "病案号++++住院号=病案号",
-            "签名++++=签名"
-    );
-
-    /**
-     * 给structureMap添加一个key(映射)
-     *
-     * @param structureMap
-     * @param target       需要用到的key
-     * @param source       structureMap中含有的key
-     */
-    protected void addKeyMapping(Map<String, String> structureMap, String target, String source) {
-        if (StringUtils.isEmpty(structureMap.get(target)) && StringUtils.isNotEmpty(structureMap.get(source))) {
-            structureMap.put(target, structureMap.get(source));
-        }
-    }
+    private List<String> operationSafetyChecklist_keyContrasts = Lists.newArrayList();
 
 }

+ 30 - 41
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyRescueDocTrans.java

@@ -1,14 +1,16 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.RescueDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.trans.ModelDocTrans;
-import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyRescueXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -18,15 +20,22 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/17 17:34
  */
+@Slf4j
 public class YwzxyyRescueDocTrans extends ModelDocTrans {
-    private String modeId = "22";
 
     @Override
     public List<RescueDoc> extract(MedrecVo medrecVo) {
         List<RescueDoc> retList = Lists.newArrayList();
         List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
         contentMaps.forEach(contentMap -> {
-            retList.add(getRescueDoc(contentMap));
+            try {
+                RescueDoc rescueDoc = getRescueDoc(contentMap);
+                if (rescueDoc != null) {
+                    retList.add(rescueDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         });
         return retList;
     }
@@ -37,45 +46,25 @@ public class YwzxyyRescueDocTrans extends ModelDocTrans {
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            if (sourceMap.containsKey("原始文本")) {
-                String originalText = sourceMap.get("原始文本");
-                List<String> titles = Lists.newArrayList("抢救记录","抢救实施的时间及措施", "抢救后的状况", "参加抢救人员姓名及专业技术职称", "医师签名");
-                CommonAnalysisUtil.cutByTitlesNoColon(originalText, titles, 0, sourceMap);
-            }
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
-            if (structureMap.containsKey("抢救措施") && structureMap.containsKey("抢救实施的时间及措施")) {
-                structureMap.put("抢救措施", structureMap.get("抢救措施").replace(structureMap.get("抢救实施的时间及措施"), ""));
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyRescueXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "22");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
             }
         }
-
-        RescueDoc rescueDoc = new RescueDoc();
-        rescueDoc.setStructureMap(structureMap);
-        rescueDoc.setPageData((Map) structureMap);
-
-        return rescueDoc;
+        if (MapUtils.isNotEmpty(structureMap)) {
+            RescueDoc rescueDoc = ModelDocGenerate.rescueDocGen(structureMap);
+            rescueDoc.setPageData((Map) structureMap);
+            return rescueDoc;
+        } else {
+            return null;
+        }
     }
 
-    private List<String> keyContrasts = Lists.newArrayList(
-            "事件日期=开始时间",
-            "抢救病情=病情变化",
-            "本人姓名=姓名",
-            "抢救结束日期=结束时间",
-            "抢救开始日期=开始时间",
-            "抢救经过与措施=抢救措施",
-            "病情变化情况=简要病情",
-            "是否成功=抢救是否成功",
-            "参与抢救人员名单=参加抢救的医务人员姓名及专业技术职称",
-            "参加抢救人员名单=参加抢救的医务人员姓名及专业技术职称",
-            "记录医师=记录医生",
-            "患者签名时间=记录时间",
-            "抢救记录=简要病情",
-            "医师签名=记录医生",
-            "抢救实施的时间及措施=抢救措施",
-            "病程内容=抢救措施"
-    );
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 30 - 34
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyStagesSummaryDocTrans.java

@@ -1,14 +1,16 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.StagesSummaryDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.trans.ModelDocTrans;
-import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyStagesSummaryXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -18,15 +20,22 @@ import java.util.Map;
  * @author: rengb
  * @time: 2020/3/19 19:41
  */
+@Slf4j
 public class YwzxyyStagesSummaryDocTrans extends ModelDocTrans {
-    private String modeId = "28";
 
     @Override
     public List<StagesSummaryDoc> extract(MedrecVo medrecVo) {
         List<StagesSummaryDoc> retList = Lists.newArrayList();
         List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
         contentMaps.forEach(contentMap -> {
-            retList.add(getStagesSummaryDoc(contentMap));
+            try {
+                StagesSummaryDoc stagesSummaryDoc = getStagesSummaryDoc(contentMap);
+                if (stagesSummaryDoc != null) {
+                    retList.add(stagesSummaryDoc);
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         });
         return retList;
     }
@@ -37,38 +46,25 @@ public class YwzxyyStagesSummaryDocTrans extends ModelDocTrans {
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            List<String> titles = Lists.newArrayList("入院时情况", "入院诊断", "辅助检查",
-                    "诊治经过", "目前情况", "目前诊断", "进一步诊疗方案",
-                    "记录医师");
-            String text = sourceMap.get("原始文本");
-            List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
-            CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
-            if(structureMap.containsKey("病程内容")){
-                structureMap.put("病程内容",structureMap.get("病程内容").split("入院时情况")[0]);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyStagesSummaryXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "28");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
             }
         }
-
-        StagesSummaryDoc stagesSummaryDoc = new StagesSummaryDoc();
-        stagesSummaryDoc.setStructureMap(structureMap);
-        stagesSummaryDoc.setPageData((Map) structureMap);
-
-        return stagesSummaryDoc;
+        if (MapUtils.isNotEmpty(structureMap)) {
+            StagesSummaryDoc stagesSummaryDoc = ModelDocGenerate.stagesSummaryDocGen(structureMap);
+            stagesSummaryDoc.setPageData((Map) structureMap);
+            return stagesSummaryDoc;
+        } else {
+            return null;
+        }
     }
 
-    private List<String> keyContrasts = Lists.newArrayList(
-            "本人姓名=姓名",
-            "现病史- 发病情况=发病情况",
-            "体温(耳)=体温耳",
-            "医师签名=记录医生",
-            "进一步诊疗方案=诊疗计划",
-            "入院时情况=入院情况",
-            "记录医师=记录医生",
-            "病程时间=记录时间"
-    );
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 36 - 32
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyThreeLevelWardDocTrans.java

@@ -1,10 +1,7 @@
 package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.lt.facade.ModelHospitalFacade;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
@@ -19,7 +16,11 @@ import com.lantone.qc.pub.util.SpringContextUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyThreeLevelWardXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
 import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import java.util.Calendar;
@@ -35,24 +36,23 @@ import java.util.stream.Collectors;
  * @time: 2020/3/17 13:27
  */
 @Setter
+@Slf4j
 public class YwzxyyThreeLevelWardDocTrans extends ModelDocTrans {
-    private String modeId = "4";
-    private List<String> recTitles;
     private List<OperationDoc> operationDocs;
 
     @Override
     public List<ThreeLevelWardDoc> extract(MedrecVo medrecVo) {
-        ModelHospitalFacade modelHospitalFacade = SpringContextUtil.getBean(ModelHospitalFacade.class);
-        recTitles = modelHospitalFacade.getRecTitles(5l, 4l);
-
         List<ThreeLevelWardDoc> retList = Lists.newArrayList();
+        ThreeLevelWardDoc threeLevelWardDoc = new ThreeLevelWardDoc();
         List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
-
-        ThreeLevelWardDoc result = new ThreeLevelWardDoc();
         contentMaps.forEach(contentMap -> {
-            classifyThreeLevelWardDoc(result, contentMap);
+            try {
+                classifyThreeLevelWardDoc(threeLevelWardDoc, contentMap);
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         });
-        retList.add(result);
+        retList.add(threeLevelWardDoc);
         return retList;
     }
 
@@ -62,31 +62,35 @@ public class YwzxyyThreeLevelWardDocTrans extends ModelDocTrans {
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
             String recTitle = contentMap.get("recTitle").toString();
-            if (recTitles.contains(recTitle)) {
-                sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            }
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
-
-            if (StringUtils.isEmpty(structureMap.get("查房日期"))) {
-                return;
-            }
-            //不能简单的标准转化,如果有查房标题,优先使用
-            if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("查房备注"))) {
-                structureMap.put("查房标题", structureMap.get("查房备注"));
-            }
-            if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("查房类别"))) {
-                structureMap.put("查房标题", structureMap.get("查房类别"));
-            }
-            if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("上级查房医生职称"))) {
-                structureMap.put("查房标题", structureMap.get("上级查房医生职称"));
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyThreeLevelWardXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "4");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
             }
         }
+        if (MapUtils.isEmpty(structureMap)) {
+            return;
+        }
+        if (StringUtils.isEmpty(structureMap.get("查房日期"))) {
+            return;
+        }
+        //不能简单的标准转化,如果有查房标题,优先使用
+        if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("查房备注"))) {
+            structureMap.put("查房标题", structureMap.get("查房备注"));
+        }
+        if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("查房类别"))) {
+            structureMap.put("查房标题", structureMap.get("查房类别"));
+        }
+        if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("上级查房医生职称"))) {
+            structureMap.put("查房标题", structureMap.get("上级查房医生职称"));
+        }
         //总的查房记录 汇总
         ThreeLevelWardDoc allDoctorWradDoc = new ThreeLevelWardDoc();
+        allDoctorWradDoc.setText(structureMap.get("原始文本"));
         allDoctorWradDoc.setStructureMap(structureMap);
         allDoctorWradDoc.setPageData((Map) structureMap);
         result.addAllDoctorWradDoc(allDoctorWradDoc);

+ 124 - 76
trans/src/main/java/com/lantone/qc/trans/ywzxyy/YwzxyyTransferRecordDocTrans.java

@@ -2,8 +2,6 @@ package com.lantone.qc.trans.ywzxyy;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
-import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.transferrecord.TransferIntoDoc;
 import com.lantone.qc.pub.model.doc.transferrecord.TransferOutDoc;
 import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
@@ -13,10 +11,16 @@ 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.comsis.OrdinaryAssistant;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyTransferIntoXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyTransferOutXmlAnalysis;
+import com.lantone.qc.trans.ywzxyy.util.YwzxyyXmlAnalysis;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
 
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -26,8 +30,10 @@ import java.util.TreeMap;
  * @author: rengb
  * @time: 2020/3/20 16:10
  */
+@Slf4j
 public class YwzxyyTransferRecordDocTrans extends ModelDocTrans {
 
+    @Override
     public TransferRecordDoc extract(MedrecVo medrecVo) {
         TransferRecordDoc transferRecordDoc = new TransferRecordDoc();
 
@@ -38,15 +44,19 @@ public class YwzxyyTransferRecordDocTrans extends ModelDocTrans {
         List<Map<String, Object>> into = (List) contentMap.get("转入记录");
         List<Map<String, Object>> out = (List) contentMap.get("转出记录");
         List<Map<String, Object>> all = new ArrayList<>();
+
+        Map<String, TransferIntoDoc> transferIntoDocMap = new HashMap<>();
+        Map<String, TransferOutDoc> transferOutDocMap = new HashMap<>();
         if (into != null) {
             all.addAll(into);
+            transferIntoDocMap = getTransferIntoDocMap(into);
         }
         if (out != null) {
             all.addAll(out);
+            transferOutDocMap = getTransferOutDocMap(out);
         }
-        Map<String, TransferIntoDoc> transferIntoDocMap = getTransferIntoDocMap(into);
-        Map<String, TransferOutDoc> transferOutDocMap = getTransferOutDocMap(out);
-        Map<String, TransferRecordDoc> transferAllDocMap = getTransferAllDocMap(all);
+        //        Map<String, TransferRecordDoc> transferAllDocMap = getTransferAllDocMap(all);
+        Map<String, TransferRecordDoc> transferAllDocMap = Maps.newHashMap();
 
         //转入
         Map<Date, TransferIntoDoc> dateRecordIn = new TreeMap<>(new Comparator<Date>() {
@@ -58,9 +68,9 @@ public class YwzxyyTransferRecordDocTrans extends ModelDocTrans {
         });
         for (TransferIntoDoc transferIntoDoc : transferIntoDocMap.values()) {
             Map<String, String> structureMap = transferIntoDoc.getStructureMap();
-            String inDateStr = structureMap.get("转日期");
+            String inDateStr = structureMap.get("转日期");
             if (StringUtil.isBlank(inDateStr)) {
-                continue;
+                inDateStr = structureMap.get("病历日期");
             }
             Date inDate = StringUtil.parseDateTime(inDateStr);
             if (inDate == null) {
@@ -79,9 +89,9 @@ public class YwzxyyTransferRecordDocTrans extends ModelDocTrans {
         });
         for (TransferOutDoc transferOutDoc : transferOutDocMap.values()) {
             Map<String, String> structureMap = transferOutDoc.getStructureMap();
-            String outDateStr = structureMap.get("转日期");
+            String outDateStr = structureMap.get("转日期");
             if (StringUtil.isBlank(outDateStr)) {
-                continue;
+                outDateStr = structureMap.get("病历日期");
             }
             Date outDate = StringUtil.parseDateTime(outDateStr);
             if (outDate == null) {
@@ -101,9 +111,9 @@ public class YwzxyyTransferRecordDocTrans extends ModelDocTrans {
         });
         for (TransferRecordDoc transferRecordAllDoc : transferAllDocMap.values()) {
             Map<String, String> structureMap = transferRecordAllDoc.getStructureMap();
-            String transferDateStr = structureMap.get("转日期");
+            String transferDateStr = structureMap.get("转日期");
             if (StringUtil.isBlank(transferDateStr)) {
-                continue;
+                transferDateStr = structureMap.get("病历日期");
             }
             Date transferDate = StringUtil.parseDateTime(transferDateStr);
             if (transferDate == null) {
@@ -129,44 +139,49 @@ public class YwzxyyTransferRecordDocTrans extends ModelDocTrans {
             if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
                 continue;
             }
-            transferRecordName = index + "";
-            TransferIntoDoc transferIntoDoc = getTransferIntoDoc(contentMap);
-            transferIntoDoc.setTransferRecordName(transferRecordName);
-            retMap.put(transferRecordName, transferIntoDoc);
-            index++;
+            try {
+                TransferIntoDoc transferIntoDoc = getTransferIntoDoc(contentMap);
+                if (transferIntoDoc != null) {
+                    transferRecordName = index + "";
+                    transferIntoDoc.setTransferRecordName(transferRecordName);
+                    retMap.put(transferRecordName, transferIntoDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         }
         return retMap;
     }
 
     private TransferIntoDoc getTransferIntoDoc(Map<String, Object> contentMap) {
-        String modeId = "26";
         String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        Map<String, String> sourceMap = null;
+        Map<String, String> structureMap = new HashMap<>();
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, transferInto_keyContrasts, modeId);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyTransferIntoXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "26");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        //存入转入时间
+        getTransDate(contentMap.get("transferInDate"), "转入时间", structureMap);
+        if (MapUtils.isNotEmpty(structureMap)) {
+            TransferIntoDoc transferIntoDoc = new TransferIntoDoc();
+            transferIntoDoc.setStructureMap(structureMap);
+            transferIntoDoc.setPageData((Map) structureMap);
+            return transferIntoDoc;
+        } else {
+            return null;
         }
-
-        TransferIntoDoc transferIntoDoc = new TransferIntoDoc();
-        transferIntoDoc.setText(content);
-        transferIntoDoc.setStructureMap(structureMap);
-        transferIntoDoc.setPageData((Map) sourceMap);
-
-        return transferIntoDoc;
     }
 
-    private List<String> transferInto_keyContrasts = Lists.newArrayList(
-            "书写日期=记录日期",
-            "转入时间=转入日期",
-            "本人姓名=姓名"
-    );
-
     /**************************************************全部*******************************************************/
     private Map<String, TransferRecordDoc> getTransferAllDocMap(List<Map<String, Object>> contentMaps) {
         Map<String, TransferRecordDoc> retMap = Maps.newHashMap();
@@ -179,34 +194,52 @@ public class YwzxyyTransferRecordDocTrans extends ModelDocTrans {
             if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
                 continue;
             }
-            transferRecordName = index + "";
-            TransferRecordDoc transferRecordDoc = getTransferAllDoc(contentMap);
-            transferRecordDoc.setTransferRecordName(transferRecordName);
-            retMap.put(transferRecordName, transferRecordDoc);
-            index++;
+            try {
+                TransferRecordDoc transferRecordDoc = getTransferAllDoc(contentMap);
+                if (transferRecordDoc != null) {
+                    transferRecordName = index + "";
+                    transferRecordDoc.setTransferRecordName(transferRecordName);
+                    retMap.put(transferRecordName, transferRecordDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         }
         return retMap;
     }
 
     private TransferRecordDoc getTransferAllDoc(Map<String, Object> contentMap) {
-        String modeId = "34";
         String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        Map<String, String> sourceMap = null;
+        Map<String, String> structureMap = new HashMap<>();
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, transferInto_keyContrasts);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyTransferOutXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        //存入转入时间
+        getTransDate(contentMap.get("transferInDate"), "转入时间", structureMap);
+        //存入转出时间
+        getTransDate(contentMap.get("transferOutDate"), "转出时间", structureMap);
+        if (MapUtils.isNotEmpty(structureMap)) {
+            TransferRecordDoc transferAllDoc = new TransferRecordDoc();
+            transferAllDoc.setStructureMap(structureMap);
+            transferAllDoc.setPageData((Map) structureMap);
+            return transferAllDoc;
+        } else {
+            return null;
         }
-        TransferRecordDoc transferAllDoc = new TransferRecordDoc();
-        transferAllDoc.setText(content);
-        transferAllDoc.setStructureMap(structureMap);
-        transferAllDoc.setPageData((Map) sourceMap);
-        return transferAllDoc;
     }
 
+
     /**************************************************转出*******************************************************/
     private Map<String, TransferOutDoc> getTransferOutDocMap(List<Map<String, Object>> contentMaps) {
         Map<String, TransferOutDoc> retMap = Maps.newHashMap();
@@ -219,41 +252,56 @@ public class YwzxyyTransferRecordDocTrans extends ModelDocTrans {
             if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
                 continue;
             }
-            transferRecordName = index + "";
-            TransferOutDoc transferOutDoc = getTransferOutDoc(contentMap);
-            transferOutDoc.setTransferRecordName(transferRecordName);
-            retMap.put(transferRecordName, transferOutDoc);
-            index++;
+            try {
+                TransferOutDoc transferOutDoc = getTransferOutDoc(contentMap);
+                if (transferOutDoc != null) {
+                    transferRecordName = index + "";
+                    transferOutDoc.setTransferRecordName(transferRecordName);
+                    retMap.put(transferRecordName, transferOutDoc);
+                    index++;
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
         }
         return retMap;
     }
 
     private TransferOutDoc getTransferOutDoc(Map<String, Object> contentMap) {
-        String modeId = "27";
         String content = contentMap.get("xmlText").toString();
-        Map<String, String> structureMap = null;
-        Map<String, String> sourceMap = null;
+        Map<String, String> structureMap = new HashMap<>();
         if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
             structureMap = (Map) FastJsonUtils.getJsonToMap(content);
         } else {
-            sourceMap = YiWuXmlUtil.xmlToMap(content);
-            sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-            sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-            structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, transferOut_keyContrasts, modeId);
+            String recTitle = contentMap.get("recTitle").toString();
+            String recTypeId = contentMap.get("recTypeId").toString();
+            YwzxyyXmlAnalysis ywzxyyXmlAnalysis = new YwzxyyTransferOutXmlAnalysis();
+            Map<String, String> sourceMap = ywzxyyXmlAnalysis.analysis(content, recTitle, recTypeId);
+            if (MapUtils.isNotEmpty(sourceMap)) {
+                structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, "27");
+                structureMap.put("记录编号", contentMap.get("recId").toString());
+                structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
+            }
+        }
+        //存入转出时间
+        getTransDate(contentMap.get("transferOutDate"), "转出时间", structureMap);
+        if (MapUtils.isNotEmpty(structureMap)) {
+            TransferOutDoc transferOutDoc = new TransferOutDoc();
+            transferOutDoc.setStructureMap(structureMap);
+            transferOutDoc.setPageData((Map) structureMap);
+            return transferOutDoc;
+        } else {
+            return null;
         }
-        TransferOutDoc transferOutDoc = new TransferOutDoc();
-        transferOutDoc.setText(content);
-        transferOutDoc.setStructureMap(structureMap);
-        transferOutDoc.setPageData((Map) sourceMap);
+    }
 
-        return transferOutDoc;
+    //存入转入转出时间
+    private void getTransDate(Object transferDates, String dateStr, Map<String, String> structureMap) {
+        if (transferDates != null) {
+            structureMap.put(dateStr, transferDates.toString());
+        }
     }
 
-    private List<String> transferOut_keyContrasts = Lists.newArrayList(
-            "书写日期=记录日期",
-            "转出时间=转入日期",
-            "本人姓名=姓名"
-    );
+    private List<String> keyContrasts = Lists.newArrayList();
 
 }

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyBeHospitalizedXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyBeHospitalizedXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyClinicBloodEffectXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyClinicBloodEffectXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyClinicalBloodXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyClinicalBloodXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyCrisisValueReportXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyCrisisValueReportXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyCriticallyIllNoticeXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyCriticallyIllNoticeXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyDeathCaseDiscussXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyDeathCaseDiscussXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyDeathRecordXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyDeathRecordXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyDifficultCaseDiscussXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyDifficultCaseDiscussXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyFirstCourseRecordXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyFirstCourseRecordXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyLeaveHospitalXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyLeaveHospitalXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyOperationDiscussionXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyOperationDiscussionXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyOperationRecordXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyOperationRecordXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyPreoperativeDiscussionXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyPreoperativeDiscussionXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyRescueXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyRescueXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyStagesSummaryXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyStagesSummaryXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyThreeLevelWardXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyThreeLevelWardXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyTransferIntoXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyTransferIntoXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 17 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyTransferOutXmlAnalysis.java

@@ -0,0 +1,17 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:04
+ */
+public class YwzxyyTransferOutXmlAnalysis implements YwzxyyXmlAnalysis {
+
+    @Override
+    public Map<String, String> analysis(String... args) {
+        return null;
+    }
+
+}

+ 14 - 0
trans/src/main/java/com/lantone/qc/trans/ywzxyy/util/YwzxyyXmlAnalysis.java

@@ -0,0 +1,14 @@
+package com.lantone.qc.trans.ywzxyy.util;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2021/1/25 14:02
+ */
+public interface YwzxyyXmlAnalysis {
+
+    Map<String,String> analysis(String...args);
+
+}