Преглед изворни кода

温附一:规则问题修改

wangsy пре 3 година
родитељ
комит
719ce18ea1

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

@@ -37,6 +37,7 @@ public class BEH0034 extends QCCatalogue {
                         .filter(i ->
                                 i != null && StringUtil.isNotBlank(i.getName()) && i.getNegative() == null
                                         && !"手术史".equals(i.getName()) && !"手术".equals(i.getName()) && !"手术治疗".equals(i.getName())
+                                        && !"手术无手术史".equals(i.getName())
                         )
                         .map(i -> i.getName())
                         .distinct()

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

@@ -21,7 +21,7 @@ public class BEH0036 extends QCCatalogue {
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if(inputInfo.getBeHospitalizedDoc() == null){
+        if (inputInfo.getBeHospitalizedDoc() == null) {
             return;
         }
         List<Operation> operations = inputInfo.getBeHospitalizedDoc().getPastLabel().getOperations();
@@ -32,7 +32,7 @@ public class BEH0036 extends QCCatalogue {
             if (operation == null || StringUtil.isBlank(operation.getName())) {
                 continue;
             }
-            if ("手术史".equals(operation.getName()) || "手术".equals(operation.getName()) || "手术治疗".equals(operation.getName())) {
+            if ("手术史".equals(operation.getName()) || "手术".equals(operation.getName()) || "手术治疗".equals(operation.getName()) || "手术无手术史".equals(operation.getName())) {
                 continue;
             }
             if ((operation.getNegative() == null || StringUtil.isBlank(operation.getNegative().getName()))

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0088.java

@@ -13,7 +13,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @ClassName : FIRC0087
+ * @ClassName : FIRC0088
  * @Description : 鉴别诊断不全面
  * @Author : 胡敬
  * @Date: 2020-03-06 17:28

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03087.java

@@ -29,7 +29,7 @@ public class FIRC03087 extends QCCatalogue {
             return;
         }
         String text = treatPlanLabel.getText();
-        if (StringUtil.isBlank(text) || text.contains("检查")) {
+        if (StringUtil.isBlank(text) || text.contains("检查") || text.contains("三大常规") || text.contains("CT")) {
             status.set("0");
             return;
         }

+ 87 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/wenfuyi/firstcourserecord/FIRC0087.java

@@ -0,0 +1,87 @@
+package com.lantone.qc.kernel.catalogue.hospital.wenfuyi.firstcourserecord;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.client.ChiefPresentSimilarityServiceClient;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
+import com.lantone.qc.pub.model.label.CaseCharacteristicLabel;
+import com.lantone.qc.pub.model.label.DiagLabel;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @ClassName : FIRC0087
+ * @Description : 无鉴别诊断
+ * @Author : 楼辉荣
+ * @Date: 2020-03-06 17:28
+ */
+@Component
+public class FIRC0087 extends QCCatalogue {
+    @Autowired
+    ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient;
+
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        if (firstCourseRecordDoc != null) {
+            DiagLabel differentialDiagLabel = firstCourseRecordDoc.getDifferentialDiagLabel();
+            CaseCharacteristicLabel casecharLabel = firstCourseRecordDoc.getCaseCharacteristicLabel();
+            DiagLabel initDiagLabel = firstCourseRecordDoc.getInitialDiagLabel();
+
+            if (differentialDiagLabel != null) {
+                Map<String, String> structureMap = firstCourseRecordDoc.getStructureMap();
+                String diffDiagStruct = structureMap.get("诊断依据及鉴别诊断");
+                if (StringUtils.isNotEmpty(diffDiagStruct)) {
+                    return;
+                }
+                /*if (StringUtil.isNotBlank(diffDiagStruct) && (diffDiagStruct.contains("诊断明确") || diffDiagStruct.contains("无需鉴别")
+                        || diffDiagStruct.contains("明确诊断"))) {
+                    return;
+                }*/
+
+                //List<Diag> diags = differentialDiagLabel.getDiags();
+                if (initDiagLabel.getDiags().size() > 0) {
+                    String diag = initDiagLabel.getDiags().get(0).getHospitalDiagName();
+                    String casechar = casecharLabel.getText();
+                    String chief = "";
+                    String present = "";
+                    if (casechar.contains("主诉") && casechar.contains("现病史")) {
+                        chief = casechar.substring(casechar.indexOf("主诉") + 2, casechar.indexOf("现病史"));
+                        present = casechar.substring(casechar.indexOf("现病史") + 3, casechar.indexOf("既往史"));
+                    }
+                    if (StringUtils.isNotEmpty(differentialDiagLabel.getText())) {
+                        if (differentialDiagLabel.getText().contains("诊断明确")
+                                || differentialDiagLabel.getText().contains("无需鉴别")) {
+                            if (chief.contains("术后") || chief.contains("孕") || chief.contains("化疗")
+                                    || chief.contains("肿瘤") || chief.contains("癌") || chief.contains("确诊")
+                                    || chief.contains("外伤") || chief.contains("摔伤")) {
+                                status.set("0");
+                            } else if (present.contains(diag)) {
+                                status.set("0");
+                            } else {
+                                status.set("-1");
+                            }
+                        }
+                    } else if (StringUtils.isEmpty(differentialDiagLabel.getText())) {
+                        status.set("-1");
+                    }
+                /*
+                if(diags == null || diags.size()<1){
+                    status.set("-1");
+                }
+
+                if (StringUtils.isNotEmpty(differentialDiagLabel.getText())
+                        && (differentialDiagLabel.getText().contains("暂缺")
+                            || differentialDiagLabel.getText().contains("无") || differentialDiagLabel.getText().contains("诊断"))) {
+                    status.set("0");
+                }
+                */
+                }
+            }
+        }
+    }
+}

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/wenfuyi/firstcourserecord/FIRC0088.java

@@ -13,7 +13,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @ClassName : FIRC0087
+ * @ClassName : FIRC0088
  * @Description : 鉴别诊断不全面
  * @Author : 胡敬
  * @Date: 2020-03-06 17:28
@@ -29,7 +29,7 @@ public class FIRC0088 extends QCCatalogue {
         Map<String, String> firstCourseStructureMap = firstCourseRecordDoc.getStructureMap();
         String diffDiag = firstCourseStructureMap.get("诊断依据及鉴别诊断");
         if (StringUtil.isBlank(diffDiag) || diffDiag.contains("诊断明确") || diffDiag.contains("无需鉴别")
-                || diffDiag.contains("明确诊断") || diffDiag.contains("诊断基本明确")) {
+                || diffDiag.contains("明确诊断") || diffDiag.contains("诊断基本明确") || diffDiag.contains("首先考虑")) {
             return;
         }
         DiagLabel differentialDiagLabel = firstCourseRecordDoc.getDifferentialDiagLabel();

+ 54 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/wenfuyi/operationdiscussion/OPE0358.java

@@ -0,0 +1,54 @@
+package com.lantone.qc.kernel.catalogue.hospital.wenfuyi.operationdiscussion;
+
+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.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * @Description: 手术记录中术后诊断未填写
+ * @author: rengb
+ * @time: 2020/3/23 15:09
+ */
+@Component
+public class OPE0358 extends QCCatalogue {
+
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        //医嘱
+        //        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        //        if (ListUtil.isEmpty(doctorAdviceDocs)) {
+        //            return;
+        //        }
+        //        boolean isOperativePatient = CatalogueUtil.isOperativePatients(doctorAdviceDocs);
+//        boolean isOperativePatient = true;//是手术患者(暂时默认是)
+//        if (isOperativePatient) {
+            List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if(operationDocs == null || operationDocs.size() == 0){
+            status.set("0");
+            return;
+        }
+            if (ListUtil.isNotEmpty(operationDocs)) {
+                long count = operationDocs.stream().filter(operationDoc -> {
+                    boolean flag = false;
+                    if (operationDoc.getOperationRecordDoc() != null
+                            && StringUtil.isBlank(operationDoc.getOperationRecordDoc().getStructureMap().get("术中诊断"))) {
+                        flag = true;
+                    }
+                    return flag;
+                }).count();
+                if (count > 0) {
+                    status.set("-1");
+                }
+            }
+//        }
+    }
+
+}

+ 119 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/wenfuyi/threelevelward/THR02900.java

@@ -0,0 +1,119 @@
+package com.lantone.qc.kernel.catalogue.hospital.wenfuyi.threelevelward;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+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.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+import com.lantone.qc.pub.util.DateUtil;
+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.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : THR02900
+ * @Description : 术后24小时内无主刀或一助查房记录
+ * @Author : 胡敬
+ * @Date: 2020-05-27 14:23
+ */
+@Component
+public class THR02900 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getOperationDocs().size() == 0) {
+            return;
+        }
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        List<ThreeLevelWardDoc> allDoctorWradDocs = new ArrayList<>();
+        if (inputInfo.getThreeLevelWardDocs() != null && inputInfo.getThreeLevelWardDocs().size() > 0) {
+            allDoctorWradDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
+        }
+        //标题
+        String allTitle = "";
+        //病情记录
+        String allPathography = "";
+        String[] split = null;
+        //一助或助手
+        String firstAssistant = "";
+        //手术结束时间
+        String opeEndTime = "";
+        for (OperationDoc operationDoc : operationDocs) {
+            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+            if (operationRecordDoc == null) {
+                continue;
+            }
+            Map<String, String> structureMap = operationRecordDoc.getStructureMap();
+            firstAssistant = structureMap.get("一助");
+            opeEndTime = structureMap.get("结束时间");
+
+            String chiefSurgeon = structureMap.get("主刀签名");
+            if (StringUtil.isNotBlank(chiefSurgeon)) {
+                chiefSurgeon = chiefSurgeon.replace(" ", "");
+            }
+            Date opeEndDate = CatalogueUtil.parseStringDate(opeEndTime);
+            if (opeEndDate == null) {
+                continue;
+            }
+            if (!CatalogueUtil.compareTime(
+                    StringUtil.parseDateTime(opeEndTime),
+                    StringUtil.parseDateTime(DateUtil.nowString()),
+                    Long.valueOf(24 * 60))) {//如果接收未超过6小时,规则不判断
+                return;
+            } else {
+                if ((StringUtil.isNotEmpty(chiefSurgeon) || StringUtil.isNotEmpty(firstAssistant)) && ListUtil.isEmpty(allDoctorWradDocs)) {
+                    status.set("-1");
+                    return;
+                }
+            }
+            if (ListUtil.isNotEmpty(allDoctorWradDocs)) {
+                for (ThreeLevelWardDoc wardDoc : allDoctorWradDocs) {
+                    Map<String, String> wardStructureMap = wardDoc.getStructureMap();
+                    String recordDateStr = wardStructureMap.get("查房日期");
+                    String recordTitle = wardStructureMap.get("查房标题");
+                    String writTitle = wardStructureMap.get("文书标题");
+                    String pathography = wardStructureMap.get("病情记录");
+                    Date recordDate = CatalogueUtil.parseStringDate(recordDateStr);
+                    if (StringUtil.isBlank(recordTitle) || StringUtil.isBlank(pathography) || recordDate == null) {
+                        continue;
+                    }
+                    if (opeEndDate.before(recordDate) && !CatalogueUtil.compareTime(opeEndDate, recordDate, 24 * 60L)) {
+                        allTitle += recordTitle;
+                        allPathography += pathography;
+                        if (StringUtil.isNotBlank(writTitle)) {
+                            allTitle += writTitle;
+                        }
+                    }
+                }
+            }
+            //查房标题中有主刀
+            if (allTitle.contains("主刀") || allTitle.contains("术后第一天") || allTitle.contains("术后第1天")) {
+                return;
+            }
+            //病情记录对比
+            if ((StringUtil.isNotBlank(chiefSurgeon) && allPathography.contains(chiefSurgeon)) || allPathography.contains("术后第一天") || allPathography.contains("术后第1天") ||
+                    (StringUtil.isNotBlank(firstAssistant) && allPathography.contains(firstAssistant))) {
+                return;
+            }
+            //查房标题对比
+            if (StringUtil.isNotBlank(chiefSurgeon) && !allTitle.contains(chiefSurgeon) &&
+                    StringUtil.isNotBlank(firstAssistant) && !allTitle.contains(firstAssistant)) {
+                status.set("-1");
+                return;
+            } else if (StringUtil.isBlank(chiefSurgeon) && StringUtil.isBlank(firstAssistant) && split.length > 1) {
+                for (int i = 0; i < split.length; i++) {
+                    if (allTitle.contains(split[i])) {
+                        return;
+                    }
+                }
+            }
+        }
+    }
+}

+ 89 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/wenfuyi/threelevelward/THR03090.java

@@ -0,0 +1,89 @@
+package com.lantone.qc.kernel.catalogue.hospital.wenfuyi.threelevelward;
+
+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.doc.DoctorAdviceDoc;
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.util.DateUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @ClassName : THR03090
+ * @Description : 手术患者无术前主刀医师查房记录
+ * @Author : wsy
+ * @Date: 2021-01-11 10:39
+ */
+@Component
+public class THR03090 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        long cou = inputInfo.getOperationDocs().stream().map(OperationDoc::getOperationRecordDoc).filter(Objects::nonNull).count();
+        if (cou == 0) {
+            return;
+        }
+        if (threeLevelWardDocs.size() == 0 && cou > 0) {
+            status.set("-1");
+            return;
+        }
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        if (operationDocs == null || operationDocs.size() == 0) {
+            return;
+        }
+        String operationStartDate = "";
+        if (operationDocs.get(operationDocs.size() - 1).getOperationRecordDoc() != null) {
+            Map<String, String> operationDocStructureMap = operationDocs.get(operationDocs.size() - 1).getOperationRecordDoc().getStructureMap();
+            operationStartDate = operationDocStructureMap.get("开始时间");
+            if (StringUtil.parseDateTime(operationStartDate) == null) {
+                operationStartDate = DateUtil.nowString();
+            }
+        }
+
+        if (StringUtil.isBlank(operationStartDate)) {
+            return;
+        }
+
+        List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
+        for (ThreeLevelWardDoc threeLevelWard : allDoctorWradDocs) {
+            Map<String, String> structureMap = threeLevelWard.getStructureMap();
+            String makeTitle = structureMap.get("查房标题");
+            String writTitle = structureMap.get("文书标题");
+            String makeDate = structureMap.get("查房日期");
+            if (StringUtil.isNotBlank(makeDate) && StringUtil.parseDateTime(makeDate).before(StringUtil.parseDateTime(operationStartDate))) {
+                if (((StringUtil.isNotBlank(makeTitle) && makeTitle.contains("主刀")) || (StringUtil.isNotBlank(writTitle) && writTitle.contains("主刀"))
+                        || ((StringUtil.isNotBlank(makeTitle) && makeTitle.contains("术前")) || (StringUtil.isNotBlank(writTitle) && writTitle.contains("术前"))))) {
+                    return;
+                }
+            }
+        }
+
+        //判断医嘱里有无手术
+        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        if (doctorAdviceDocs.size() == 0) {
+            return;
+        }
+        for (DoctorAdviceDoc dad : doctorAdviceDocs) {
+            String name = dad.getStructureMap().get("医嘱项目名称");
+            if (name.contains("非手术") || name.contains("手术室") || (name.contains("手术") && name.contains("取消")) || (name.contains("暂停") && name.contains("手术")) || name.contains("静脉穿刺置管术") || name.startsWith("停") || name.contains("前一次")
+                    || name.contains("特殊病人手术使用一次性卫生材料") || name.contains("人免疫缺陷病毒抗体检测免费")) {
+                continue;
+            }
+            if (name.contains("手术")) {
+                status.set("-1");
+                return;
+            }
+        }
+
+        if (cou > 0) {
+            status.set("-1");
+            return;
+        }
+    }
+}

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03090.java

@@ -46,6 +46,9 @@ public class THR03090 extends QCCatalogue {
             }
         }
 
+        if (StringUtil.isBlank(operationStartDate) || StringUtil.parseDateTime(operationStartDate) == null) {
+            return;
+        }
         List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
         for (ThreeLevelWardDoc threeLevelWard : allDoctorWradDocs) {
             Map<String, String> structureMap = threeLevelWard.getStructureMap();