Browse Source

宁海妇保医院问题修改

wangsy 4 years ago
parent
commit
81f33f6afc

+ 7 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaifuyao/firstpagerecord/FIRP0163.java

@@ -5,6 +5,7 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -18,13 +19,18 @@ import java.util.Map;
 @Component
 public class FIRP0163 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if (inputInfo.getFirstPageRecordDoc() == null){
+        if (inputInfo.getFirstPageRecordDoc() == null) {
             status.set("0");
             return;
         }
         if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String idNumber = firstpageStructureMap.get(Content.idNumber);
+            String dept = firstpageStructureMap.get("入院科别");
+            if (StringUtil.isNotBlank(dept) && "NICU".equals(dept)) {
+                status.set("0");
+                return;
+            }
             if (!CatalogueUtil.isEmpty(idNumber)) {
                 status.set("0");
             }

+ 14 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaifuyao/firstpagerecord/FIRP0209.java

@@ -7,6 +7,8 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -17,12 +19,23 @@ import java.util.Map;
  */
 @Component
 public class FIRP0209 extends QCCatalogue {
+    private List<String> containList = Arrays.asList("农民", "家务", "自由职业者", "个体经营者", "无业人员", "儿童");
+
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String dischargeTime = firstpageStructureMap.get(Content.work_unit);
-            if(StringUtil.isBlank(dischargeTime)){
+            String job = firstpageStructureMap.get(Content.job);
+            if (StringUtil.isBlank(job)) {
+                return;
+            }
+            for (String str : containList) {
+                if (str.contains(job)) {
+                    return;
+                }
+            }
+            if (StringUtil.isBlank(dischargeTime) || "—".equals(dischargeTime)) {
                 status.set("-1");
             }
 

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaifuyao/firstpagerecord/FIRP0210.java

@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
 import java.util.Map;
 
 /**
- * @ClassName : FIRP0211
+ * @ClassName : FIRP0210
  * @Description : 居住电话未填写
  * @Author : 楼辉荣
  * @Date: 2020-03-06 17:28ss

+ 6 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaifuyao/firstpagerecord/FIRP0211.java

@@ -22,7 +22,12 @@ public class FIRP0211 extends QCCatalogue {
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String dischargeTime = firstpageStructureMap.get(Content.work_unit_phone);
-            if(StringUtil.isBlank(dischargeTime)){
+            //工作单位 (无工作单位者无需填写单位邮编、电话及地址)
+            String workUnit = firstpageStructureMap.get(Content.work_unit);
+            if (StringUtil.isBlank(workUnit) || "—".equals(workUnit)) {
+                return;
+            }
+            if (StringUtil.isBlank(dischargeTime) || "—".equals(dischargeTime)) {
                 status.set("-1");
             }
 

+ 6 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/ninghaifuyao/firstpagerecord/FIRP0214.java

@@ -22,7 +22,12 @@ public class FIRP0214 extends QCCatalogue {
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String dischargeTime = firstpageStructureMap.get(Content.work_unit_zipcode);
-            if(StringUtil.isBlank(dischargeTime)){
+            //工作单位 (无工作单位者无需填写单位邮编、电话及地址)
+            String workUnit = firstpageStructureMap.get(Content.work_unit);
+            if (StringUtil.isBlank(workUnit) || "—".equals(workUnit)) {
+                return;
+            }
+            if (StringUtil.isBlank(dischargeTime) || "—".equals(dischargeTime)) {
                 status.set("-1");
             }
 

+ 47 - 63
trans/src/main/java/com/lantone/qc/trans/ninghaifuyao/util/NingHaiFuYaoOperationRecordHtmlAnalysis.java

@@ -33,12 +33,9 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
             String recTypeId = args[2];
             Element headerElement = Jsoup.parse(html).selectFirst("body").child(0).getElementById("header");
             //宁海妇幼的手术记录header不是table
-            if(headerElement.selectFirst("tbody")==null)
-            {
+            if (headerElement.selectFirst("tbody") == null) {
                 analysisHeader(headerElement, map);
-            }
-            else
-            {
+            } else {
                 NingHaiFuYaoHtmlAnalysisUtil.tableStyle1InsertMap(Jsoup.parse(html).selectFirst("body").child(0).getElementById("header"), map);
             }
             map.forEach((key, value) -> map.put(key, value.replace("\n", "")));
@@ -75,30 +72,28 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
                 }
             }
             //宁海产科手术记录处理
-            if(map.containsKey("开始")&&map.containsKey("结束")
-                    &&!map.containsKey("手术开始时间")&&!map.containsKey("手术结束时间")
-                    &&!map.containsKey("手术日期"))
-            {
+            if (map.containsKey("开始") && map.containsKey("结束")
+                    && !map.containsKey("手术开始时间") && !map.containsKey("手术结束时间")
+                    && !map.containsKey("手术日期")) {
                 map.put("手术开始时间", map.get("开始"));
                 String endTime = map.get("结束");
-                if(endTime.contains("手术名称"))
-                {
+                if (endTime.contains("手术名称")) {
                     CommonAnalysisUtil.html2StructureMapNoColon
-                            (Lists.newArrayList("手术名称","术前诊断","手术指征","术后诊断"),endTime,map);
+                            (Lists.newArrayList("手术名称", "术前诊断", "手术指征", "术后诊断"), endTime, map);
                     endTime = endTime.split("手术名称")[0].trim();
                 }
                 map.put("手术结束时间", endTime);
-                map.put("手术日期",map.get("手术开始时间"));
+                map.put("手术日期", map.get("手术开始时间"));
 
             }
 
-            if(map.containsKey("手术开始时间") && map.containsKey("手术结束时间")){
-                map.put("手术日期",map.get("手术开始时间"));
+            if (map.containsKey("手术开始时间") && map.containsKey("手术结束时间")) {
+                map.put("手术日期", map.get("手术开始时间"));
             }
 
             //这些科室的手术时间写了好几种格式分别处理
 //           List<String> departmentList =  Lists.newArrayList("妇科","十六病区VIP");
-           getOperaTime(map,null);
+            getOperaTime(map, null);
             CommonAnalysisUtil.makeEmpty(map, "医生签名");
             NingHaiFuYaoHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
@@ -107,71 +102,60 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
         return map;
     }
 
-    private void getOperaTime(Map<String, String> map,List<String> departmentList) {
+    private void getOperaTime(Map<String, String> map, List<String> departmentList) {
 //        if(map.containsKey("病区")&&departmentList.contains(map.get("病区")))
-        if(map.containsKey("病区"))
-        {
+        if (map.containsKey("病区")) {
             //手术日期: 2021-01-06 手术时间: 上午
-            if(map.containsKey("手术日期")&&map.containsKey("手术时间"))
-            {
-                if(map.get("手术时间").contains(":")|map.get("手术时间").contains(": ")
-                                            |map.get("手术时间").contains(": "))
-                {
-                    map.put("手术时间",map.get("手术时间").replaceAll(":",":")
-                                                        .replaceAll(": ",":")
-                                                        .replaceAll(": ",":"));
+            if (map.containsKey("手术日期") && map.containsKey("手术时间")) {
+                if (map.get("手术时间").contains(":") | map.get("手术时间").contains(": ")
+                        | map.get("手术时间").contains(": ")) {
+                    map.put("手术时间", map.get("手术时间").replaceAll(":", ":")
+                            .replaceAll(": ", ":")
+                            .replaceAll(": ", ":"));
                 }
                 Pattern p = Pattern.compile("[0-9]+:[0-9][0-9]|[0-9][0-9]+:[0-9][0-9]");
                 Matcher m = p.matcher(map.get("手术时间"));
 
                 String pattern = "(上午|下午|晚上|凌晨|中午|晚)";
-                if(StringUtil.isNotBlank(map.get("手术时间"))&& Pattern.matches(pattern, map.get("手术时间"))){
-                    map.put("手术时间",map.get("手术日期"));
+                if (StringUtil.isNotBlank(map.get("手术时间")) && Pattern.matches(pattern, map.get("手术时间"))) {
+                    map.put("手术时间", map.get("手术日期"));
                 }
                 //如果手术时间为时刻没有具体某天例:(手术日期: 2021年01月05日 手术时间: 12:10)
-                else if(m.find())
-                {
-                    map.put("手术时间",map.get("手术日期")+m.group(0));
+                else if (m.find()) {
+                    map.put("手术时间", map.get("手术日期") + m.group(0));
                 }
             }
             //手术时间:2021-01-05 10:12-10:40 或 开始时间-结束时间 排除没有日期的手术时间10:12-10:40
             String operationStartDateStr = map.get("手术时间");
-            if(StringUtil.isNotBlank(operationStartDateStr)&&operationStartDateStr.contains("-")&&
-                    operationStartDateStr.length()>11)
-            {
+            if (StringUtil.isNotBlank(operationStartDateStr) && operationStartDateStr.contains("-") &&
+                    operationStartDateStr.length() > 11) {
                 //手术时间 -> 2021.01.1210:55--12:15
-                if(operationStartDateStr.contains("--"))
-                {
-                    operationStartDateStr = operationStartDateStr.substring(0,operationStartDateStr.lastIndexOf("--")).trim();
-                }
-                else
-                {
-                    operationStartDateStr = operationStartDateStr.substring(0,operationStartDateStr.lastIndexOf("-")).trim();
+                if (operationStartDateStr.contains("--")) {
+                    operationStartDateStr = operationStartDateStr.substring(0, operationStartDateStr.lastIndexOf("--")).trim();
+                } else {
+                    operationStartDateStr = operationStartDateStr.substring(0, operationStartDateStr.lastIndexOf("-")).trim();
                 }
-                if(StringUtil.parseDateTime(operationStartDateStr, Content.dateFormats)!=null)
-                {
-                    map.put("手术时间",operationStartDateStr);
+                if (StringUtil.parseDateTime(operationStartDateStr, Content.dateFormats) != null) {
+                    map.put("手术时间", operationStartDateStr);
                 }
             }
             //手术日期 -> 2021年01月15日15时25分- 2021年01月15日16时05分 无手术时间
-            if(map.containsKey("手术日期"))
-            {
+            if (map.containsKey("手术日期")) {
                 Pattern p = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日[0-9]+时[0-9]+分");
                 Matcher m = p.matcher(map.get("手术日期"));
                 if (m.find()) {
-                    map.put("手术日期",m.group(0));
+                    map.put("手术日期", m.group(0));
                 }
             }
             //手术时间:2021-01-06 上午
-            if(map.containsKey("手术时间"))
-            {
-                map.put("手术时间",map.get("手术时间")
-                        .replaceAll("上午","")
-                        .replaceAll("下午","")
-                        .replaceAll("中午","")
-                        .replaceAll("晚上","")
-                        .replaceAll("晚","")
-                        .replaceAll("凌晨","").trim());
+            if (map.containsKey("手术时间")) {
+                map.put("手术时间", map.get("手术时间")
+                        .replaceAll("上午", "")
+                        .replaceAll("下午", "")
+                        .replaceAll("中午", "")
+                        .replaceAll("晚上", "")
+                        .replaceAll("晚", "")
+                        .replaceAll("凌晨", "").trim());
             }
         }
     }
@@ -183,13 +167,13 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
         String text = NingHaiFuYaoHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
         text = text.replaceAll("第1页", "");
         List<String> titles = Lists.newArrayList(
-                "姓名", "性别", "出生日期", "出生年月", "科别", "科室", "病区", "床号", "床位", "住院号","手术开始时间","手术结束时间",
-                "手术时间", "手术日期", "手术前诊断",  "手术中诊断", "手术后诊断","手术指征", "手术人员", "外邀指导专家","麻醉方式", "麻醉人员", "麻 醉 者", "洗手护士", "本次手术是否属于非计划再次手术", "接生者",
+                "姓名", "性别", "出生日期", "出生年月", "科别", "科室", "病区", "床号", "床位", "住院号", "手术开始时间", "手术结束时间",
+                "手术时间", "手术日期", "手术前诊断", "手术中诊断", "手术后诊断", "手术指征", "手术人员", "外邀指导专家", "麻醉方式", "麻醉人员", "麻 醉 者", "洗手护士", "本次手术是否属于非计划再次手术", "接生者",
                 "术前胎心", "手术名称", "术后诊断", "手术者及助手名称", "术中取病理标本", "麻醉方法", "手术经过(包括病人体位、切口处理、病灶所见及手术步骤等)",
-                "诊断手术/操作简要经过(包括术中有无并发症及具体描述和处理)", "手术经过","医师签名","麻 醉","术前诊断",
+                "诊断手术/操作简要经过(包括术中有无并发症及具体描述和处理)", "手术经过", "医师签名", "麻 醉", "术前诊断",
                 "医生签名", "记录时间", "时间", "手术/操作医生", "记录者", "术中输血", "术前宫颈准备日期", "药物名称及用法", "导管或其他", "插入深度",
                 "阴道填塞纱布条", "准备者", "取出日期", "手术方法", "术中特殊情况", "病理检查", "其他", "记录者", "手术者",
-                "检查子宫位置","开始","结束","LMP"
+                "检查子宫位置", "开始", "结束", "LMP"
         );
         titles = CommonAnalysisUtil.sortTitles(titles, text);
         CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
@@ -203,9 +187,9 @@ public class NingHaiFuYaoOperationRecordHtmlAnalysis implements NingHaiFuYaoHtml
         }*/
         String text = NingHaiFuYaoHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
         text = text.replaceAll("第1页", "")
-                .replaceAll("_____________________________________________________________________________________","");
+                .replaceAll("_____________________________________________________________________________________", "");
         List<String> titles = Lists.newArrayList(
-                "姓名", "病区", "床号", "住院号","年龄"
+                "姓名", "出生日期", "病区", "床号", "住院号", "年龄"
         );
         titles = CommonAnalysisUtil.sortTitles(titles, text);
         CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);