Bladeren bron

Merge remote-tracking branch 'origin/hb/beilun' into hb/beilun

hecc 3 jaren geleden
bovenliggende
commit
4d1a8af536

+ 7 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0304.java

@@ -28,15 +28,15 @@ import java.util.stream.Collectors;
 @Component
 public class CLI0304 extends QCCatalogue {
     /**
-     * 1.病历包含【输血*记录】时,获取【临时医嘱】处方类型为(化验/检验/检查)是否存在:(输血前检查/术前三项/术前四项/感染四项/输血前四项)中任意一项,
+     * 1.病历包含【输血*记录】时,获取【临时医嘱】处方类型为(化验/检验/检查)是否存在:(输血前检查/术前三项/术前四项/感染四项/输血前四项/输血前筛查)中任意一项,
      * 1.1若不存在查(乙*肝、丙*肝、人类免疫缺陷病毒、梅毒)是否全部存在,仍不存在报出。
      * 1.2存在后再查(血型/血型鉴定/血型血清学检查/血型鉴定与抗体筛查)是否存在任意一项,不存在则报出。
      * 1.3都存在时判断化验医嘱开始日期是否都在“输血*记录”之前。多份输血记录时只走第一份时间,日期只对比到天数
      * 2.【临时医嘱】包含【输*血/输*红细胞/输*血小板/输*血浆/输*冷沉淀因子】但排除带“预约”。出现时。获取【临时医嘱】处方类型为(化验/检验/检查)是否存在:
-     * 2.1(输血前检查/术前三项/术前四项/感染四项/输血前四项)中任意一项。若不存在查(乙*肝、丙*肝、人类免疫缺陷病毒、梅毒)是否全部存在,仍不存在报出,
+     * 2.1(输血前检查/术前三项/术前四项/感染四项/输血前四项/输血前筛查)中任意一项。若不存在查(乙*肝、丙*肝、人类免疫缺陷病毒、梅毒)是否全部存在,仍不存在报出,
      * 2.2存在后再查(血型/血型鉴定/血型血清学检查/血型鉴定与抗体筛查)是否存在任意一项,不存在则报出。
      * 2.3都存在时判断化验医嘱开始日期是否都在“输血医嘱”之前。多份输血医嘱只走最早时间,只对比到天数
-     * 3.【病案首页】(血费>0)出现时,获取【临时医嘱】处方类型为(化验/检验/检查)是否存在:(输血前检查/术前三项/术前四项/感染四项/输血前四项)中任意一项。
+     * 3.【病案首页】(血费>0)出现时,获取【临时医嘱】处方类型为(化验/检验/检查)是否存在:(输血前检查/术前三项/术前四项/感染四项/输血前四项/输血前筛查)中任意一项。
      * 3.1若不存在查(乙*肝、丙*肝、人类免疫缺陷病毒、梅毒)是否全部存在,仍不存在报出,
      * 3.2存在后再查(血型/血型鉴定/血型血清学检查/血型鉴定与抗体筛查)是否存在任意一项,不存在则报出。
      */
@@ -51,7 +51,7 @@ public class CLI0304 extends QCCatalogue {
             return;
         }
 
-        String regex1 = "输血前检查|术前三项|术前四项|感染四项|输血前四项";
+        String regex1 = "输血前检查|术前三项|术前四项|感染四项|输血前四项|输血前筛查";
         String regex2 = "乙[\\u4E00-\\u9FA5A-Za-z]{0,}肝";
         String regex3 = "丙[\\u4E00-\\u9FA5A-Za-z]{0,}肝";
         String regex4 = "血型|血型鉴定|血型血清学检查|血型鉴定与抗体筛查";
@@ -234,5 +234,8 @@ public class CLI0304 extends QCCatalogue {
                 }
             }
         }
+
+        status.set("0");
+        return;
     }
 }

+ 120 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/wenfuyi/clinicalblood/CLI0301.java

@@ -0,0 +1,120 @@
+package com.lantone.qc.kernel.catalogue.hospital.wenfuyi.clinicalblood;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+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.model.doc.*;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : CLI0301
+ * @Description : 无输血或使用血液制品知情同意书
+ * @Author : cy
+ * @Date: 2021-04-18 14:49
+ */
+@Component
+public class CLI0301 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        boolean flag = false;
+        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
+        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        /**
+         *是否输血了
+         */
+        //输血记录
+        if (ListUtil.isNotEmpty(clinicalBloodDocs)) {
+            flag = true;
+        }
+        //血费
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        if (firstPageRecordDoc != null && firstPageRecordDoc.getStructureMap() != null) {
+            String bloodFee = firstPageRecordDoc.getStructureMap().get("血费");
+            if (StringUtil.isNotEmpty(bloodFee) && !bloodFee.equals("0")) {
+                double blood = Double.parseDouble(bloodFee);
+                if (blood > 0) {
+                    flag = true;
+                }
+            }
+        }
+        //医嘱
+        if (ListUtil.isNotEmpty(doctorAdviceDocs)) {
+            for (DoctorAdviceDoc doctorAdviceDoc : doctorAdviceDocs) {
+                Map<String, String> doctorAdviceDocStrMap = doctorAdviceDoc.getStructureMap();
+                String daStatus = doctorAdviceDocStrMap.get(Content.doctorAdviceState);
+                if (StringUtil.isNotEmpty(daStatus)) {
+                    if (!Content.cancellationOrderList.contains(daStatus)) {
+                        //取临时医嘱
+                        String doctorAsks = doctorAdviceDocStrMap.get(Content.doctorAdviceType);
+                        if (StringUtil.isEmpty(doctorAsks)) {
+                            continue;
+                        }
+                        if (Content.statOrder.equals(doctorAsks)) {
+                            String daItemName = doctorAdviceDocStrMap.get(Content.medicalOrderName);
+                            if (StringUtil.isNotEmpty(daItemName)) {
+                                if (dateStr(daItemName)) {
+                                    flag = true;
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+//判断是否含有知情同意书
+        if (flag) {
+            status.set("-1");
+            List<InformedConsentDoc> informedConsentDocList = inputInfo.getInformedConsentDoc();
+            if (ListUtil.isNotEmpty(informedConsentDocList)) {
+                for (InformedConsentDoc informedConsentDoc : informedConsentDocList) {
+                    String str = informedConsentDoc.getStructureMap().get("标题");
+                    if (StringUtil.isBlank(str)) {
+                        continue;
+                    }
+                    String rex = "[\\s\\S]*(?=输血)[^,;,;。]{0,10}(?=知情同意书)[\\s\\S]*";
+                    if (str.matches(rex)) {
+                        status.set("0");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+
+    private boolean dateStr(String str) {
+        if (StringUtil.isEmpty(str)) {
+            return false;
+        }
+        str = str.replaceAll("\\*", "\\\\*");
+        str = str.replaceAll("\\)", "\\\\)");
+        str = str.replaceAll("\\.", "\\\\.");
+        str = str.replaceAll("\\?", "\\\\?");
+        str = str.replaceAll("\\+", "\\\\+");
+        str = str.replaceAll("\\$", "\\\\$");
+        str = str.replaceAll("\\^", "\\\\^");
+        str = str.replaceAll("\\[", "\\\\[");
+        str = str.replaceAll("\\]", "\\\\]");
+        str = str.replaceAll("\\(", "\\\\(");
+        str = str.replaceAll("\\{", "\\\\{");
+        str = str.replaceAll("\\}", "\\\\}");
+        str = str.replaceAll("\\|", "\\\\|");
+        str = str.replaceAll("\\/", "\\\\/");
+        String rex1 = "[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=血)[\\s\\S]*";
+        String rex2 = "[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=红细胞)[\\s\\S]*";
+        String rex3 = "[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=血小板)[\\s\\S]*";
+        String rex4 = "[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=血浆)[\\s\\S]*";
+        String rex5 = "[\\s\\S]*(?=输)[^,;,;。]{0,6}(?=冷沉淀因子)[\\s\\S]*";
+        if (str.matches(rex1) || str.matches(rex2) || str.matches(rex3) || str.matches(rex4) || str.matches(rex5)) {
+            return true;
+        }
+        return false;
+    }
+}

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/util/RegexUtil.java

@@ -46,7 +46,7 @@ public class RegexUtil {
             }
             Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
             Matcher matcher = pattern.matcher(content);
-            if (matcher.find()) {
+            while (matcher.find()) {
                 count++;
             }
             if (count >= num) {