Browse Source

北仑: 病程中抗生素记录不规范抗生素后含有数字,不提示用量

wangsy 4 years ago
parent
commit
d47ebd4a67

+ 28 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/threelevelward/THR03077.java

@@ -276,7 +276,7 @@ public class THR03077 extends QCCatalogue {
         }
     }
 
-    List<String> usageWords = Lists.newArrayList("WB", "wb", "泵","静滴");
+    List<String> usageWords = Lists.newArrayList("WB", "wb", "泵", "静滴");
 
     /**
      * 收集各模块药品信息
@@ -289,6 +289,8 @@ public class THR03077 extends QCCatalogue {
         StringBuffer sb = null;
         for (Drug drug : drugs) {
             sb = new StringBuffer();
+            String behindWord = "";
+            String lastBehindWord = "";
             String wardDrug = drug.getName();
             int position = content.indexOf(wardDrug);
             int lastPosition = content.lastIndexOf(wardDrug);
@@ -304,8 +306,8 @@ public class THR03077 extends QCCatalogue {
                     continue;
                 }
 
-                String behindWord = content.substring(position, Math.min(position + 15, content.toCharArray().length));
-                String lastBehindWord = content.substring(lastPosition, Math.min(lastPosition + 10, content.toCharArray().length));
+                behindWord = content.substring(position, Math.min(position + 20, content.toCharArray().length));
+                lastBehindWord = content.substring(lastPosition, Math.min(lastPosition + 20, content.toCharArray().length));
                 if (behindWord != lastBehindWord) {
                     if (lastBehindWord.contains("阴性")) {
                         continue;
@@ -322,8 +324,15 @@ public class THR03077 extends QCCatalogue {
                 wardDrug = drugStandardWord;
             }
             if (drug.getConsumption() == null) {
-                concatInfo(dateStr, sb, "用量");
+                if (StringUtil.isBlank(behindWord)) {
+                    concatInfo(dateStr, sb, "用量");
+                } else {
+                    if (!hasDigit(behindWord) && !hasDigit(lastBehindWord)) {
+                        concatInfo(dateStr, sb, "用量");
+                    }
+                }
             }
+
             int index = content.indexOf(drugUsageWard);
             String drugContent = content.substring(Math.max(0, index));
             boolean isUsage = true;
@@ -351,6 +360,21 @@ public class THR03077 extends QCCatalogue {
         }
     }
 
+    /**
+     * 判断一个字符串是否含有数字
+     *
+     * @param content
+     */
+    public boolean hasDigit(String content) {
+        boolean flag = false;
+        Pattern p = Pattern.compile(".*\\d+.*");
+        Matcher m = p.matcher(content);
+        if (m.matches()) {
+            flag = true;
+        }
+        return flag;
+    }
+
     /**
      * 拼接抗生素缺失信息
      *