瀏覽代碼

修改逻辑及bug

hujing 5 年之前
父節點
當前提交
468e9f5637

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0017.java

@@ -56,5 +56,8 @@ public class BEH0017 extends QCCatalogue {
         } else {
             status.set("0");
         }
+        if (presentLabel.getPds().size() > 0) {
+            status.set("0");
+        }
     }
 }

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0072.java

@@ -31,7 +31,8 @@ public class BEH0072 extends QCCatalogue {
             String familyText = familyLabel.getText();
             if (StringUtil.isNotBlank(familyText)) {
                 familyText = familyText.substring(0, Math.min(10, familyText.length()));
-                if (familyText.contains("死因") || familyText.contains("原因") || familyText.contains("详")) {
+                if (familyText.contains("死因") || familyText.contains("原因") || familyText.contains("详")
+                || familyText.contains("因")) {
                     return;
                 }
             }

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

@@ -34,7 +34,7 @@ public class BEH0441 extends QCCatalogue {
         }
         String presentText = presentLabel.getText();
         if (StringUtil.isNotBlank(presentText)) {
-            List<String> words = Lists.newArrayList("胃纳", "食纳", "食欲", "未纳", "纳眠", "饮食", "纳眠","禁食","未食","鼻饲");
+            List<String> words = Lists.newArrayList("胃纳", "食纳", "食欲", "未纳", "纳眠", "饮食", "纳眠","禁食","未食","鼻饲","食");
             for (String word : words) {
                 if (presentText.contains(word)) {
                     status.set("0");

+ 5 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0202.java

@@ -22,10 +22,13 @@ public class FIRP0202 extends QCCatalogue {
         if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String newbornAdmisWeightStr = firstpageStructureMap.get(Content.newbornAdmisWeight);
-            if (CatalogueUtil.isEmpty(newbornAdmisWeightStr) || "-".equals(newbornAdmisWeightStr)|| "—".equals(newbornAdmisWeightStr)) {
+            if (CatalogueUtil.isEmpty(newbornAdmisWeightStr) || !CatalogueUtil.numbersOnly(newbornAdmisWeightStr)) {
                 return;
             }
-            int newbornAdmisWeight = Integer.parseInt(newbornAdmisWeightStr);
+            double newbornAdmisWeight = Double.parseDouble(newbornAdmisWeightStr);
+            if (newbornAdmisWeight / 1000 >= 1) {
+                newbornAdmisWeight = newbornAdmisWeight / 1000;
+            }
             if (newbornAdmisWeight <= 1 || newbornAdmisWeight >= 10) {
                 status.set("-1");
             }

+ 43 - 44
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0149.java

@@ -25,57 +25,56 @@ public class LEA0149 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
-        if (leaveHospitalDoc == null) {
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if (leaveHospitalDoc == null || beHospitalizedDoc == null) {
             status.set("0");
             return;
         }
         DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
-        if (deathRecordDoc == null || deathRecordDoc.getText() == null) {
-            BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
-            if (beHospitalizedDoc != null) {
-                Map<String, String> lhStructureMap = leaveHospitalDoc.getStructureMap();
-                ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
-                if (lhStructureMap != null && chiefLabel != null) {
-                    String bhChief = CatalogueUtil.int2ChineseNum(chiefLabel.getText().replaceAll("[\\p{Punct}\\pP。-]", ""));
-                    String leaveChief = lhStructureMap.get("主诉");
-                    String bhThings = lhStructureMap.get("入院情况");
-                    if (StringUtil.isNotBlank(bhThings)){
-                        bhThings = CatalogueUtil.int2ChineseNum(bhThings.replaceAll("[\\p{Punct}\\pP。-]", ""));
-                    }
-
-                    //如果出院小结结构化数据能取出主诉,则直接用该主诉和入院记录主诉比较
-                    if (StringUtil.isNotBlank(leaveChief)) {
-                        leaveChief = leaveChief.replaceAll("[\\p{Punct}\\pP。-]", "");
-                        if (bhChief.equals(leaveChief)) {
-                            status.set("0");
-                            return;
-                        }
-                    }
-                    if (StringUtil.isNotBlank(bhThings) && bhThings.replace(" ","").contains(bhChief.replace(" ",""))) {
-                        status.set("0");
-                        return;
-                    }
-                    Pattern compile = Pattern.compile("(?<=2.).*(?=3.体格检查)");
-                    Matcher matcher = compile.matcher(bhThings);
-                    while (matcher.find()) {
-                        String number = matcher.group(0);
-                        if (CatalogueUtil.isEmpty(number)) {
-                            status.set("-1");
-                        }
-                    }
-                    //处理台州的
-                    if (bhThings.contains("患者因")) {
-                        status.set("0");
-                    }
-
+        if (deathRecordDoc != null) {
+            status.set("0");
+            return;
+        }
+        Map<String, String> lhStructureMap = leaveHospitalDoc.getStructureMap();
+        ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
+        if (lhStructureMap != null && chiefLabel != null) {
+            String bhChief = CatalogueUtil.int2ChineseNum(chiefLabel.getText().replaceAll("[\\p{Punct}\\pP。-]", ""));
+            String leaveChief = lhStructureMap.get("主诉");
+            String bhThings = lhStructureMap.get("入院情况");
+            if (StringUtil.isNotBlank(bhThings)) {
+                bhThings = CatalogueUtil.int2ChineseNum(bhThings.replaceAll("[\\p{Punct}\\pP。-]", ""));
+            }
 
-                    //                    bhThings = bhThings.replaceAll("[\\p{Punct}\\pP]", "");
-                    //                    if (bhThings.indexOf(bhChief) < 0) {
-                    //                        status.set("-1");
-                    //                    }
+            //如果出院小结结构化数据能取出主诉,则直接用该主诉和入院记录主诉比较
+            if (StringUtil.isNotBlank(leaveChief)) {
+                leaveChief = leaveChief.replaceAll("[\\p{Punct}\\pP。-]", "");
+                if (bhChief.equals(leaveChief)) {
+                    status.set("0");
+                    return;
                 }
             }
-        }
+            if (StringUtil.isNotBlank(bhThings) && bhThings.replace(" ", "").contains(bhChief.replace(" ", ""))) {
+                status.set("0");
+                return;
+            }
+            Pattern compile = Pattern.compile("(?<=2.).*(?=3.体格检查)");
+            Matcher matcher = compile.matcher(bhThings);
+            while (matcher.find()) {
+                String number = matcher.group(0);
+                if (CatalogueUtil.isEmpty(number)) {
+                    status.set("-1");
+                }
+            }
+            //处理台州的
+            if (bhThings.contains("患者因")) {
+                status.set("0");
+            }
+
 
+            //                    bhThings = bhThings.replaceAll("[\\p{Punct}\\pP]", "");
+            //                    if (bhThings.indexOf(bhChief) < 0) {
+            //                        status.set("-1");
+            //                    }
+        }
     }
 }

+ 17 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE0351.java

@@ -5,6 +5,7 @@ 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.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -42,7 +43,22 @@ public class OPE0351 extends QCCatalogue {
                 }
                 return flag;
             }).count();
-            if (count > 0) {
+            long matchCount = operationDocs.stream().filter(operationDoc -> {
+                boolean flag = false;
+                if (operationDoc.getOperationDiscussionDoc() != null
+                        && StringUtil.isNotBlank(operationDoc.getOperationDiscussionDoc().getText())
+                        && (operationDoc.getOperationDiscussionDoc().getText().contains("体温")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("呼吸")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("脉搏")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("血压")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("心率")
+                )) {
+                    flag = true;
+                }
+                return flag;
+            }).count();
+            /* count为术后首程中没有生命体征的数量,matchCount为术后首程包含体温 呼吸 脉搏 血压 心率这些词的数量 */
+            if (count > 0 && matchCount == 0) {
                 status.set("-1");
             }
         }