瀏覽代碼

1.修改逻辑及bug
2.添加规则BEH02908、BEH02909

hujing 5 年之前
父節點
當前提交
4b0878ccf4

+ 49 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02908.java

@@ -0,0 +1,49 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+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.label.ChiefLabel;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : BEH02908
+ * @Description : 现病史症状性质描述与主诉不符
+ * @Author : 胡敬
+ * @Date: 2020-06-11 15:54
+ */
+@Component
+public class BEH02908 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        String chiefProperty = "";
+        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        if (chiefLabel == null || presentLabel == null) {
+            return;
+        }
+        String chiefText = chiefLabel.getText();
+        String presentText = presentLabel.getText();
+        if (StringUtil.isBlank(chiefText) || StringUtil.isBlank(presentText)) {
+            return;
+        }
+        String regex = "\\d+次";
+        Pattern pattern = Pattern.compile(regex);
+        Matcher matcher = pattern.matcher(chiefText);
+        if (matcher.find()) {
+            chiefProperty = matcher.group(0);
+        }
+        if (StringUtil.isNotBlank(chiefProperty) && !presentText.contains(chiefProperty)) {
+            status.set("-1");
+        }
+    }
+}

+ 79 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02909.java

@@ -0,0 +1,79 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+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.Medicine;
+import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName : BEH02909
+ * @Description : 目前使用药物情况与现病史描述不一致
+ * @Author : 胡敬
+ * @Date: 2020-06-11 16:10
+ */
+@Component
+public class BEH02909 extends QCCatalogue {
+
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        String drugsCurrentlyInUse = inputInfo.getBeHospitalizedDoc().getStructureMap().get("目前使用的药物");
+        drugsCurrentlyInUse = StringUtil.isBlank(drugsCurrentlyInUse) ? "" : drugsCurrentlyInUse;
+        List<String> drug = getDrug(drugsCurrentlyInUse);
+        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
+        if (presentLabel == null) {
+            status.set("0");
+            return;
+        }
+        List<Medicine> medicines = presentLabel.getMedicines();
+        if (medicines != null && medicines.size() > 0) {
+            List<String> drugFromPresent = getDrugFromPresent(medicines);
+            if (ListUtil.equals(drug, drugFromPresent)) {
+                status.set("0");
+            }
+        }
+    }
+
+    private List<String> getDrug(String drugsCurrentlyInUse) {
+        List<String> drugs = new ArrayList<>();
+        String medicine = "药物名称", usage = "用法", continueUse = "本次住院是否继续使用";
+        while (drugsCurrentlyInUse.length() > 0) {
+            if (drugsCurrentlyInUse.contains(medicine) && drugsCurrentlyInUse.contains(usage) && drugsCurrentlyInUse.contains(continueUse)) {
+                int medicineIndex = drugsCurrentlyInUse.indexOf(medicine);
+                int usageIndex = drugsCurrentlyInUse.indexOf(usage);
+                int continueUseIndex = drugsCurrentlyInUse.indexOf(continueUse);
+                String drug = drugsCurrentlyInUse.substring(medicineIndex + medicine.length() + 1, usageIndex);
+                if (StringUtil.isNotBlank(drug)) {
+                    drug = StringUtil.removeBlank(drug);
+                    drugs.add(drug);
+                }
+                drugsCurrentlyInUse = drugsCurrentlyInUse.substring(continueUseIndex + continueUse.length() + 1);
+            } else {
+                break;
+            }
+        }
+        return drugs;
+    }
+
+    private List<String> getDrugFromPresent(List<Medicine> medicines) {
+        List<String> drugs = new ArrayList<>();
+        String name;
+        for (Medicine medicine : medicines) {
+            name = medicine.getName();
+            if (StringUtil.isNotBlank(name)) {
+                drugs.add(name.replaceAll("[“”\"]",""));
+            }
+        }
+        return drugs;
+    }
+}

+ 4 - 12
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0438.java

@@ -1,12 +1,11 @@
 package com.lantone.qc.kernel.catalogue.behospitalized;
 
 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.util.StringUtil;
 import org.springframework.stereotype.Component;
 
-import java.util.Collection;
 import java.util.Map;
 
 
@@ -24,16 +23,9 @@ public class BEH0438 extends QCCatalogue {
             return;
         }
         Map<String, String> bhMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
-        if(bhMap != null){
-            String birthDate = bhMap.get("出生时间");
-            if(birthDate != null){
-                if(CatalogueUtil.isEmpty(birthDate)){
-                    status.set("-1");
-                }
-            }else {
-                status.set("-1");
-            }
+        String birthDate = bhMap.get("出生日期");
+        if (StringUtil.isBlank(birthDate)) {
+            status.set("-1");
         }
-
     }
 }

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0173.java

@@ -35,6 +35,9 @@ public class FIRP0173 extends QCCatalogue {
             //现病史所有诊断
             List<Diag> presentDiags = inputInfo.getBeHospitalizedDoc().getPresentLabel().getDiags();
             for (Diag diag : presentDiags) {
+                if (diag.getNegative() != null){
+                    continue;
+                }
                 if (diag.getHospitalDiagName().equals(outpatientEmergencyDiag)) {
                     status.set("0");
                     return;

+ 1 - 0
trans/src/main/java/com/lantone/qc/trans/taizhou/TaiZhouBeHospitalizedDocTrans.java

@@ -65,6 +65,7 @@ public class TaiZhouBeHospitalizedDocTrans extends ModelDocTrans {
             "工作场所=工作单位",
             "信息来源=病史陈述者",
             "生日=出生日期",
+            "出生时间=出生日期",
             "病人出生日期=出生日期",
             "新生儿出生日期=出生日期",
             "出生地址=户口地址",