Browse Source

义乌规则修改逻辑bug

zhangzw 4 years ago
parent
commit
3960da7096

+ 5 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/yiwu/behospitalized/BEH0024.java

@@ -33,6 +33,11 @@ public class BEH0024 extends QCCatalogue {
             status.set("0");
             return;
         }
+        String past = behStructureMap.get("既往史");
+        if (StringUtil.isNotBlank(past) && past.contains("外伤史")) {
+            status.set("0");
+            return;
+        }
         PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
         /* 如果既往史为空或者既往史文本为空,则不报错 */
         if (pastLabel == null || StringUtil.isBlank(pastLabel.getText())) {

+ 5 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/yiwu/behospitalized/BEH0026.java

@@ -28,6 +28,11 @@ public class BEH0026 extends QCCatalogue {
             return;
         }
         Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String past = structureMap.get("既往史");
+        if (StringUtil.isNotBlank(past) && past.contains("食物过敏史")) {
+            status.set("0");
+            return;
+        }
         if (StringUtils.isNotEmpty(structureMap.get("过敏史"))) {
             status.set("0");
             return;

+ 5 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/yiwu/behospitalized/BEH0028.java

@@ -32,6 +32,11 @@ public class BEH0028 extends QCCatalogue {
             status.set("0");
             return;
         }
+        String past = behStructure.get("既往史");
+        if (StringUtil.isNotBlank(past) && past.contains("输血史")) {
+            status.set("0");
+            return;
+        }
         PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
         /* 如果既往史为空或者既往史文本为空,则不报错 */
         if (pastLabel == null || StringUtil.isBlank(pastLabel.getText())) {

+ 5 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/yiwu/behospitalized/BEH0029.java

@@ -36,6 +36,11 @@ public class BEH0029 extends QCCatalogue {
             status.set("0");
             return;
         }
+        String past = structureMap.get("既往史");
+        if (StringUtil.isNotBlank(past) && past.contains("预防接种")) {
+            status.set("0");
+            return;
+        }
         PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
         //个人史
         PersonalLabel personalLabel = beHospitalizedDoc.getPersonalLabel();

+ 16 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/yiwu/firstpagerecord/FIRP0199.java

@@ -4,10 +4,12 @@ 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.operation.OperationDoc;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * @ClassName : FIRP0199
@@ -19,8 +21,20 @@ import java.util.Map;
 public class FIRP0199 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
-            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+        if (inputInfo.getFirstPageRecordDoc() != null) {
+            if (inputInfo.getMedicalRecordInfoDoc() != null) {
+                String wardName = inputInfo.getMedicalRecordInfoDoc().getStructureMap().get("wardName");
+                if (StringUtil.isNotBlank(wardName) && wardName.contains("产")) {
+                    if (inputInfo.getOperationDocs().size() > 0 && inputInfo.getOperationDocs().stream().map(OperationDoc::getOperationRecordDoc).anyMatch(Objects::nonNull)) {
+                        Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+                        String newbornWeight = firstpageStructureMap.get(Content.newbornWeight);
+                        if (StringUtil.isBlank(newbornWeight)) {
+                            status.set("-1");
+                        }
+                    }
+                }
+            }
+
             /*
             String infantAgeMonths = firstpageStructureMap.get(Content.newbornAgeMonths);
             String infantAgeDays = firstpageStructureMap.get(Content.newbornAgeDays);
@@ -29,10 +43,6 @@ public class FIRP0199 extends QCCatalogue {
             }
 
              */
-            String newbornWeight = firstpageStructureMap.get(Content.newbornWeight);
-            if (StringUtil.isBlank(newbornWeight)) {
-                status.set("-1");
-            }
         }
     }
 }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/yiwu/threelevelward/THR0139.java

@@ -36,7 +36,7 @@ public class THR0139 extends QCCatalogue {
         String admisDateStr = inputInfo.getBeHospitalizedDoc().getStructureMap().get("入院日期");
         String recordDateStr = firstDirectStructureMap.get("查房日期");
         String content = firstDirectStructureMap.get("病情记录");
-        if (content.contains("初步诊断")) {
+        if (content.contains("初步诊断") || content.contains("诊断明确")) {
             status.set("0");
             return;
         }

+ 16 - 8
trans/src/main/java/com/lantone/qc/trans/yiwu/YiWuBeHospitalizedDocTrans.java

@@ -49,16 +49,13 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
             String behDeptId = behospitalInfoVO.getBehDeptId();
             if ("51923".equals(behDeptId) || "52883".equals(behDeptId) || "52903".equals(behDeptId) || "52923".equals(behDeptId) || "53523".equals(behDeptId)) {
                 Map<String, String> dailyTrans = dailyTrans(text, behDeptId);
-                dailyTrans.forEach((k, v) -> {
-                    if (!sourceMap.containsKey(k)) {
-                        sourceMap.put(k, v);
-                    }
-                });
+                mapJoin(sourceMap, dailyTrans);
             } else {
+                Map<String, String> cutMap = Maps.newHashMap();
                 List<String> titles = Lists.newArrayList("婚    姻", "婚姻状况", "住      址", "供 史 者", "性      别", "婚  姻", "民  族", "民    族", "个人史", "个 人 史", "妇科检查", "产科检查",
                         "实验室", "诊断和诊断修正", "婚 育 史", "家 族 史", "体格检查(一)", "体 格 检 查(一)", "现 病 史", "既往史", "既 往 史", "系统回顾", "其他", "职        业", "联系人及电话");
                 List<String> sortTitles = CommonAnalysisUtil.sortTitlesNoColon(titles, text);
-                CommonAnalysisUtil.cutByTitlesNoColon(text, sortTitles, 0, sourceMap);
+                CommonAnalysisUtil.cutByTitlesNoColon(text, sortTitles, 0, cutMap);
                 List<String> modifyKey = Lists.newArrayList("初步诊断", "修正诊断", "补充诊断");
                 sortTitles = CommonAnalysisUtil.sortTitlesNoColon(modifyKey, text);
                 if (text.contains("初步诊断:")) {
@@ -68,7 +65,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
                     }
                     modifyKey = Lists.newArrayList("初步诊断", "修正诊断", "补充诊断", "初步诊断医师", "修正诊断医师", "补充诊断医师", "初步诊断时间", "修正诊断时间", "补充诊断时间");
                     sortTitles = CommonAnalysisUtil.sortTitles(modifyKey, text);
-                    CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
+                    CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, cutMap);
                 }
                 if (sourceMap.containsKey("修正诊断") && (sourceMap.get("修正诊断").contains(":") || sourceMap.get("修正诊断").contains(":"))) {
                     sourceMap.put("修正诊断", "");
@@ -80,7 +77,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
                 if (text1 != null) {
                     text1.replaceAll("[0-9,、]", "");
                     List<String> sortTitles1 = CommonAnalysisUtil.sortTitles(titles1, text1);
-                    CommonAnalysisUtil.cutByTitles(text1, sortTitles1, 0, sourceMap);
+                    CommonAnalysisUtil.cutByTitles(text1, sortTitles1, 0, cutMap);
                 }
                 sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
                 sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
@@ -111,7 +108,9 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
                         sourceMap.put(str1, value);
                     }
                 }
+                mapJoin(sourceMap, cutMap);
             }
+
             structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
             OrdinaryAssistant.removeBlank(structureMap);
         }
@@ -130,6 +129,14 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
         return beHospitalizedDoc;
     }
 
+    private void mapJoin(Map<String, String> sourceMap, Map<String, String> dailyTrans) {
+        dailyTrans.forEach((k, v) -> {
+            if (!sourceMap.containsKey(k)) {
+                sourceMap.put(k, v);
+            }
+        });
+    }
+
     private List<String> keyContrasts = Lists.newArrayList(
             "初步诊断医师=初步诊断医师签名",
             "修正诊断医师=修正诊断医师签名",
@@ -146,6 +153,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
             "出生、生长史=出生生长史",
             "地址=联系地址",
             "工作场所=工作单位",
+            "患者工作单位名称=工作单位",
             "信息来源=病史陈述者",
             "生日=出生日期",
             "出生时间=出生日期",