浏览代码

台州质控修改bug

hujing 5 年之前
父节点
当前提交
c06e9c6878

+ 22 - 17
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0005.java

@@ -33,32 +33,37 @@ public class BEH0005 extends QCCatalogue {
         }
         List<PD> pds = chiefLabel.getPds();
         String chiefText = chiefLabel.getText();
-        if (chiefText.contains("检查") || chiefText.contains("术后") || chiefText.contains("药物")) {
-            return;
-        } else {
-            List<String> words = Lists.newArrayList("年", "月", "周", "天", "日", "时","分");
-            String name;
-            for (PD pd : pds) {
-                name = pd.getName();
-                if (StringUtil.isNotBlank(name)) {
+        if (StringUtil.isNotBlank(chiefText)) {
+            chiefText = chiefText.replace("月经", "");/* 月经这个词会影响逻辑判断,这里把月经这个词去除 */
+            if (chiefText.contains("检查") || chiefText.contains("术后") || chiefText.contains("药物")) {
+                return;
+            } else {
+                List<String> words = Lists.newArrayList("年", "月", "周", "天", "日", "时", "分");
+                String name;
+                for (PD pd : pds) {
+                    name = pd.getName();
+                    if (StringUtil.isBlank(name)) {
+                        continue;
+                    }
                     for (String word : words) {
                         if (name.contains(word)) {
                             timeIndex.add(chiefText.indexOf(word));
                             break;
                         }
                     }
+
                 }
             }
-        }
-        if (timeIndex.size() > 0) {
-            int min = timeIndex.get(0);
-            for (Integer data : timeIndex) {
-                if (data < min) {
-                    min = data;
+            if (timeIndex.size() > 0) {
+                int min = timeIndex.get(0);
+                for (Integer data : timeIndex) {
+                    if (data < min) {
+                        min = data;
+                    }
+                }
+                if (min != timeIndex.get(0)) {
+                    status.set("-1");
                 }
-            }
-            if (min != timeIndex.get(0)) {
-                status.set("-1");
             }
         }
     }

+ 9 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0010.java

@@ -8,6 +8,7 @@ import com.lantone.qc.pub.model.label.ChiefLabel;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
@@ -20,6 +21,9 @@ import java.util.List;
  */
 @Component
 public class BEH0010 extends QCCatalogue {
+    private List<String> containList = Arrays.asList("癌", "瘤", "复诊", "术后", "化疗后", "发现", "体检", "检查", "确诊"
+            , "诊断", "复查", "复发", "示", "超", "CT");
+
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         if (inputInfo.getBeHospitalizedDoc() == null) {
@@ -36,8 +40,11 @@ public class BEH0010 extends QCCatalogue {
             while (diagIterator.hasNext()) {
                 Diag diag = diagIterator.next();
                 String diagName = diag.getHospitalDiagName();
-                if (diagName.contains("癌") || diagName.contains("瘤") || diagName.contains("复诊") || diagName.contains("术后")) {
-                    diagIterator.remove();
+                for (String word: containList) {
+                    if (diagName.contains(word)){
+                        diagIterator.remove();
+                        break;
+                    }
                 }
             }
         }

+ 1 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0014.java

@@ -53,6 +53,7 @@ public class BEH0014 extends QCCatalogue {
             if (present.length() > 30) {
                 present = present.substring(0, 30);
             }
+            present = present.replaceAll("[\"“”]","");
             if (present.contains("体检") || present.contains("发现") || present.contains("检查") || present.contains("因")
                     || present.contains("确诊") || present.contains("诊断") || present.contains("复查") || present.contains("术后")
                     || present.contains("药物") || present.contains("误服")) {

+ 7 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02903.java

@@ -26,14 +26,17 @@ public class BEH02903 extends QCCatalogue {
 
         PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
         if (pacsLabel == null) {
+            status.set("0");
             return;
         }
 
         List<Pacs> pacses = pacsLabel.getPacses();
-        for (Pacs pacs : pacses) {
-            if (pacs.getName() == null && pacs.getPd() == null) {
-                status.set("-1");
-                return;
+        if (pacses != null && pacses.size() > 0) {
+            for (Pacs pacs : pacses) {
+                if (pacs.getName() == null && pacs.getPd() == null) {
+                    status.set("-1");
+                    return;
+                }
             }
         }
     }

+ 6 - 5
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0492.java

@@ -20,17 +20,18 @@ import java.util.Map;
 @Component
 public class BEH0492 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        status.set("0");
         if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
             return;
         }
         if (inputInfo.getBeHospitalizedDoc() != null) {
             LisLabel lisLabel = inputInfo.getBeHospitalizedDoc().getLisLabel();
-            if (lisLabel != null && CatalogueUtil.isEmpty(lisLabel.getText())) {
-                status.set("-1");
+            if (lisLabel != null && StringUtil.isNotBlank(lisLabel.getText())) {
+                status.set("0");
+                return;
             }
-            if (StringUtil.isBlank(inputInfo.getBeHospitalizedDoc().getStructureMap().get("实验室检查"))){
-                status.set("-1");/* 台州市里医院结构化判断 */
+            if (StringUtil.isNotBlank(inputInfo.getBeHospitalizedDoc().getStructureMap().get("实验室检查"))){
+                status.set("0");/* 台州市里医院结构化判断 */
             }
         }
     }

+ 17 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0493.java

@@ -1,13 +1,15 @@
 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.model.label.LisLabel;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
 import com.lantone.qc.pub.model.label.PacsLabel;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.Map;
+
 
 /**
  * @ClassName : BEH0493
@@ -18,15 +20,22 @@ import org.springframework.stereotype.Component;
 @Component
 public class BEH0493 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        status.set("0");
         if (inputInfo.getBeHospitalizedDoc() == null) {
+            status.set("0");
+            return;
+        }
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        Map<String, String> structureMap = beHospitalizedDoc.getStructureMap();
+        String pacs = structureMap.get("辅助检查结果");
+        String laboratory = structureMap.get("实验室检查");
+        String image = structureMap.get("影像学检查");
+        if (StringUtil.isNotBlank(pacs) || StringUtil.isNotBlank(laboratory) || StringUtil.isNotBlank(image)) {
+            status.set("0");
             return;
         }
-        if (inputInfo.getBeHospitalizedDoc() != null) {
-            PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
-            if (CatalogueUtil.isEmpty(pacsLabel.getText())) {
-                status.set("-1");
-            }
+        PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
+        if (pacsLabel != null && StringUtil.isNotBlank(pacsLabel.getText())) {
+            status.set("0");
         }
     }
 }

+ 18 - 3
trans/src/main/java/com/lantone/qc/trans/taizhou/TaiZhouBeHospitalizedDocTrans.java

@@ -45,11 +45,14 @@ public class TaiZhouBeHospitalizedDocTrans extends ModelDocTrans {
         sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
         Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
         OrdinaryAssistant.removeBlank(structureMap);
-        //如果有入院时间,优先使用
-        if (StringUtils.isEmpty(structureMap.get("入院时间")) && StringUtils.isNotEmpty(structureMap.get("入病房时间"))) {
+        /*if (StringUtils.isEmpty(structureMap.get("入院时间")) && StringUtils.isNotEmpty(structureMap.get("入病房时间"))) {
             structureMap.put("入院时间", structureMap.get("入病房时间"));
         }
-
+         */
+        //如果有入院时间,优先使用
+        addKeyMapping(structureMap,"入院时间","入病房时间");
+        //如果有职业,优先使用
+        addKeyMapping(structureMap,"职业","工作性质");
         BeHospitalizedDoc beHospitalizedDoc = beHospitalizedDocGen(structureMap); // 不走共用
         beHospitalizedDoc.setPageData((Map) structureMap);
         return beHospitalizedDoc;
@@ -228,4 +231,16 @@ public class TaiZhouBeHospitalizedDocTrans extends ModelDocTrans {
         return beHospitalizedDoc;
     }
 
+    /**
+     * 给structureMap添加一个key(映射)
+     * @param structureMap
+     * @param target    需要用到的key
+     * @param source    structureMap中含有的key
+     */
+    protected void addKeyMapping(Map<String, String> structureMap, String target, String source) {
+        if (StringUtils.isEmpty(structureMap.get(target)) && StringUtils.isNotEmpty(structureMap.get(source))) {
+            structureMap.put(target, structureMap.get(source));
+        }
+    }
+
 }