Browse Source

规则修改

hujing 5 years ago
parent
commit
7868f404d8

+ 15 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0059.java

@@ -4,6 +4,8 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.label.MenstrualLabel;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 /**
@@ -21,10 +23,19 @@ public class BEH0059 extends QCCatalogue {
                     || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别") == null
                     || inputInfo.getBeHospitalizedDoc().getStructureMap().get("性别").contains("男")) {
                 status.set("0"); //如果性别是男,就不报错
-            } else if (inputInfo.getBeHospitalizedDoc().getMenstrualLabel() != null
-                    && !CatalogueUtil.isEmpty(inputInfo.getBeHospitalizedDoc().getMenstrualLabel().getText()
-                    .replace("月经史:null", ""))) {
-                status.set("0"); //如果性别是女,不为空就不报错
+            } else {
+                MenstrualLabel menstrualLabel = inputInfo.getBeHospitalizedDoc().getMenstrualLabel();
+                if (menstrualLabel == null) {
+                    return;
+                }
+                String menstrualText = StringUtil.removeBlank(menstrualLabel.getText()).replaceAll("[月经史|:|:|null]", "");
+                if (StringUtil.isBlank(menstrualText)) {
+                    return;
+                }
+                boolean containChinese = CatalogueUtil.isContainChinese(menstrualText);
+                if (containChinese) {
+                    status.set("0"); //如果性别是女,不为空就不报错
+                }
             }
         }
     }

+ 13 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0472.java

@@ -1,17 +1,14 @@
 package com.lantone.qc.kernel.catalogue.behospitalized;
 
-import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
-import com.lantone.qc.pub.model.entity.Family;
-import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.label.MaritalLabel;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
 import java.util.Map;
-import java.util.regex.Pattern;
 
 /**
  * @ClassName : BEH0472
@@ -25,9 +22,13 @@ public class BEH0472 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if (beHospitalizedDoc == null) {
+            return;
+        }
+        Map<String, String> beHospitalStructureMap = beHospitalizedDoc.getStructureMap();
         if (beHospitalStructureMap != null) {
-            if (beHospitalStructureMap.get("性别") == null || beHospitalStructureMap.get("性别").contains("男")){
+            if (beHospitalStructureMap.get("性别") == null || beHospitalStructureMap.get("性别").contains("男")) {
                 status.set("0"); //如果性别是男,就不报错
                 return;
             }
@@ -36,7 +37,11 @@ public class BEH0472 extends QCCatalogue {
                     || StringUtil.isBlank(beHospitalStructureMap.get("早产"))
                     || StringUtil.isBlank(beHospitalStructureMap.get("流产"));
             if (fertilitySituation) {
-                status.set("-1");
+                //如果结构化数据中上述条件缺少,则在婚育史中查找生育情况
+                MaritalLabel maritalLabel = beHospitalizedDoc.getMaritalLabel();//婚育史
+                if (maritalLabel == null || maritalLabel.getFertility() == null) {
+                    status.set("-1");
+                }
             }
         }
     }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessThreeLevelWard.java

@@ -248,7 +248,7 @@ public class EntityProcessThreeLevelWard extends EntityProcess {
                 continue;
             }
             Diag diag = new Diag();
-            diag.setName(lemma.getText());
+            diag.setHospitalDiagName(lemma.getText());
             diags.add(diag);
         }
         if (threeLevelWardLabel.getDiags().size() == 0) {

+ 14 - 0
kernel/src/main/java/com/lantone/qc/kernel/util/CatalogueUtil.java

@@ -309,4 +309,18 @@ public class CatalogueUtil {
         String[] dateFormatsArr = new String[dateFormatsNew.size()];
         return dateFormatsNew.toArray(dateFormatsArr);
     }
+
+    /**
+     * 判断字符串是否包含中文字
+     * @param str
+     * @return
+     */
+    public static boolean isContainChinese(String str) {
+        Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
+        Matcher m = p.matcher(str);
+        if (m.find()) {
+            return true;
+        }
+        return false;
+    }
 }