Explorar o código

1.添加规则:术后24小时内无主刀或一助查房记录
出院医嘱记录不规范
2.修改禅道bug

hujing %!s(int64=5) %!d(string=hai) anos
pai
achega
4f3c0f5123

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

@@ -26,9 +26,9 @@ public class BEH0423 extends QCCatalogue {
         Map<String, String> firstStructMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
         if (bhStructureMap != null && firstStructMap != null) {
             String phone = bhStructureMap.get("电话");
-            String contactPhone = firstStructMap.get(Content.contact_phone);
-            if (!CatalogueUtil.isEmpty(phone) && !CatalogueUtil.isEmpty(contactPhone)) {
-                if (!phone.equals(contactPhone)) {
+            String currentAddressPhone = firstStructMap.get(Content.current_address_phone);
+            if (!CatalogueUtil.isEmpty(phone) && !CatalogueUtil.isEmpty(currentAddressPhone)) {
+                if (!phone.equals(currentAddressPhone)) {
                     status.set("-1");
                 }
             }

+ 46 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA02901.java

@@ -0,0 +1,46 @@
+package com.lantone.qc.kernel.catalogue.leavehospital;
+
+import com.google.common.collect.Lists;
+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.DeathRecordDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 出院医嘱记录不规范
+ * @author: 胡敬
+ * @time: 2020/05/27 19:13
+ */
+@Component
+public class LEA02901 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if (leaveHospitalDoc == null) {
+            return;
+        }
+        DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
+        if (deathRecordDoc == null || deathRecordDoc.getText() == null) {
+            Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
+            String dischargeOrder = structureMap.get("出院医嘱");
+            if (StringUtil.isNotBlank(dischargeOrder)) {
+                String words = "qd,bid,tid,qid,qh,q2h,q4h,q6h,q8h,qn,q3w,qod,biw,qw,prn,sos,ad lib,st" +
+                        ",stat,hs,am,po,ID,IH,IM,IV,OD,OL,OS,OU,ivgtt";
+                for (String word : words.split(",")) {
+                    if (dischargeOrder.contains(word)) {
+                        status.set("-1");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+}

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

@@ -25,28 +25,28 @@ public class OPE0351 extends QCCatalogue {
         //            return;
         //        }
         //        boolean isOperativePatient = CatalogueUtil.isOperativePatients(doctorAdviceDocs);
-//        boolean isOperativePatient = true;//是手术患者(暂时默认是)
-//        if (isOperativePatient) {
-            List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
-        if(operationDocs == null || operationDocs.size() == 0){
+        //        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.getOperationDiscussionDoc() != null
-                            && operationDoc.getOperationDiscussionDoc().getOperationDiscussionLabel() != null
-                            && operationDoc.getOperationDiscussionDoc().getOperationDiscussionLabel().getVitals().size() == 0) {
-                        flag = true;
-                    }
-                    return flag;
-                }).count();
-                if (count > 0) {
-                    status.set("-1");
+        if (ListUtil.isNotEmpty(operationDocs)) {
+            long count = operationDocs.stream().filter(operationDoc -> {
+                boolean flag = false;
+                if (operationDoc.getOperationDiscussionDoc() != null
+                        && operationDoc.getOperationDiscussionDoc().getOperationDiscussionLabel() != null
+                        && operationDoc.getOperationDiscussionDoc().getOperationDiscussionLabel().getVitals().size() == 0) {
+                    flag = true;
                 }
+                return flag;
+            }).count();
+            if (count > 0) {
+                status.set("-1");
             }
-//        }
+        }
+        //        }
     }
 
 }

+ 68 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR02900.java

@@ -0,0 +1,68 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+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.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.StringUtil;
+import org.springframework.stereotype.Component;
+
+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.getThreeLevelWardDocs().size() == 0 || inputInfo.getOperationDocs().size() == 0) {
+            return;
+        }
+        ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
+        List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDoc.getAllDoctorWradDocs();
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+
+        String allTitle = "";
+        for (OperationDoc operationDoc : operationDocs) {
+            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+            if (operationRecordDoc == null) {
+                continue;
+            }
+            Map<String, String> structureMap = operationRecordDoc.getStructureMap();
+            String chiefSurgeon = structureMap.get("主刀医师");
+            String firstAssistant = structureMap.get("一助");
+            String opeEndTime = structureMap.get("手术结束时间");
+            Date opeEndDate = CatalogueUtil.parseStringDate(opeEndTime);
+            if (opeEndDate == null) {
+                continue;
+            }
+            for (ThreeLevelWardDoc wardDoc : allDoctorWradDocs) {
+                Map<String, String> wardStructureMap = wardDoc.getStructureMap();
+                String recordDateStr = wardStructureMap.get("查房日期");
+                String recordTitle = wardStructureMap.get("查房标题");
+                Date recordDate = CatalogueUtil.parseStringDate(recordDateStr);
+                if (StringUtil.isBlank(recordTitle) || recordDate == null) {
+                    continue;
+                }
+                if (opeEndDate.before(recordDate) && !CatalogueUtil.compareTime(opeEndDate, recordDate, 24 * 60L)) {
+                    allTitle += recordTitle;
+                }
+            }
+
+            if (!allTitle.contains(chiefSurgeon) && !allTitle.contains(firstAssistant)) {
+                status.set("-1");
+                return;
+            }
+        }
+
+    }
+}

+ 7 - 0
kernel/src/main/java/com/lantone/qc/kernel/util/CatalogueUtil.java

@@ -337,4 +337,11 @@ public class CatalogueUtil {
         }
         return true;
     }
+
+    public static Date parseStringDate(String dateStr){
+        if (StringUtil.isBlank(dateStr)){
+            return null;
+        }
+        return StringUtil.parseDateTime(dateStr);
+    }
 }

+ 1 - 1
trans/src/main/java/com/lantone/qc/trans/changx/ChangxOperationDocTrans.java

@@ -226,7 +226,7 @@ public class ChangxOperationDocTrans extends ModelDocTrans {
             "++++深层组织手术=",
             "++++器官手术=",
             "++++空隙手术=",
-            "++++术中送检无=",
+            "++++术中送检无=术中送检",
             "++++术中送检有=",
             "冰冻切片结果=",
             "++++并发症无=",