Browse Source

Merge branch 'hb/beilun' into his/xszyy

# Conflicts:
#	kernel/src/main/resources/bootstrap.yml
Gaozk 3 years ago
parent
commit
c8eec79055

+ 5 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0181.java

@@ -19,19 +19,17 @@ import java.util.Map;
 @Component
 public class FIRP0181 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
         if (inputInfo.getFirstPageRecordDoc() == null) {
-            status.set("0");
             return;
         }
 
         if (inputInfo.getFirstCourseRecordDoc() != null) {
-            status.set("0");
             return;
         }
         Map<String, String> structureMap = inputInfo.getFirstCourseRecordDoc().getStructureMap();
         String EDStr = structureMap.get("病例特点");
         if (StringUtil.isNotBlank(EDStr) && !EDStr.contains("损伤中毒")) {
-            status.set("0");
             return;
         }
 
@@ -39,9 +37,10 @@ public class FIRP0181 extends QCCatalogue {
             Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
             String transferDept = firstpageStructureMap.get(Content.dp_out);
             String transferDept_changxing = firstpageStructureMap.get("损伤中毒因素");
-            if ((!CatalogueUtil.isEmpty(transferDept) && !"[]".equals(transferDept))
-                    || (!CatalogueUtil.isEmpty(transferDept_changxing) && !"[]".equals(transferDept_changxing))) {
-                status.set("0");
+            if ((CatalogueUtil.isEmpty(transferDept) || "[]".equals(transferDept))
+                    || (CatalogueUtil.isEmpty(transferDept_changxing) || "[]".equals(transferDept_changxing))) {
+                status.set("-1");
+                return;
             }
         }
     }

+ 41 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xiamen/operationdiscussion/OPE0369.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.consultation.ConsultationDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
@@ -25,7 +26,6 @@ import java.util.Map;
  */
 @Component
 public class OPE0369 extends QCCatalogue {
-
     @Override
     protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
         status.set("0");
@@ -38,6 +38,28 @@ public class OPE0369 extends QCCatalogue {
                 return;
             }
         }
+
+        //主治医师
+        String attendingDoctor = "";
+        //住院医师
+        String hospitalizationDoctor = "";
+        //申请医生
+        String consultationDateStr = "";
+        //记录医生
+        String consultationDoctorSign = "";
+        //病案首页
+        if (inputInfo.getFirstPageRecordDoc() != null) {
+            Map<String, String> firstPagestructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            attendingDoctor = firstPagestructureMap.get("主治医师");
+            hospitalizationDoctor = firstPagestructureMap.get("住院医师");
+        }
+        //会诊记录
+        if (inputInfo.getConsultationDocs() != null && inputInfo.getConsultationDocs().size() > 0) {
+            ConsultationDoc consultationDoc = inputInfo.getConsultationDocs().get(0);
+            Map<String, String> ConsultationStructureMap = consultationDoc.getConsultationRecordDoc().getStructureMap();
+            consultationDateStr = ConsultationStructureMap.get("申请医生");
+            consultationDoctorSign = ConsultationStructureMap.get("记录医生");
+        }
         //先判断是否有手术记录
         List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
         if (operationDocs == null || operationDocs.size() == 0) {
@@ -55,6 +77,7 @@ public class OPE0369 extends QCCatalogue {
             }
             String operationStartDate = "";
             String operatorPhysician = "";
+            int num = 0;
             List<Date> operDateList = new ArrayList<>();
             for (OperationDoc operationDoc : operationDocs) {
                 if (operationDoc.getOperationRecordDoc() != null) {
@@ -80,8 +103,25 @@ public class OPE0369 extends QCCatalogue {
                         return;
                     }
                 }
+                //手术记录中的术者如果和病案首页中的主治医师/住院医师是同一个人,那么本次手术不需要判断术前查房和术后24查房两个条目
+                if (num == 0 && StringUtil.isNotBlank(attendingDoctor) && StringUtil.isNotBlank(operatorPhysician) && operatorPhysician.contains(attendingDoctor)) {
+                    return;
+                }
+                if (num == 0 && StringUtil.isNotBlank(hospitalizationDoctor) && StringUtil.isNotBlank(operatorPhysician) && operatorPhysician.contains(hospitalizationDoctor)) {
+                    return;
+                }
+
+                //手术记录中的术者如果和会诊记录中的医生是同一个人,那么本次手术不需要判断术前查房
+                if (num == 0 && StringUtil.isNotBlank(consultationDateStr) && StringUtil.isNotBlank(operatorPhysician) && operatorPhysician.contains(consultationDateStr)) {
+                    return;
+                }
+                if (num == 0 && StringUtil.isNotBlank(consultationDoctorSign) && StringUtil.isNotBlank(operatorPhysician) && operatorPhysician.contains(consultationDoctorSign)) {
+                    return;
+                }
+                num++;
             }
 
+
             if (operDateList.size() > 1) {
                 for (int i = 0; i < operDateList.size(); i++) {
                     if (i + 1 < operDateList.size()) {

+ 33 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xiamen/threelevelward/THR0125.java

@@ -6,6 +6,8 @@ import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+import com.lantone.qc.pub.model.doc.operation.PreoperativeDiscussionDoc;
 import com.lantone.qc.pub.model.doc.ward.DirectorDoctorWardDoc;
 import com.lantone.qc.pub.util.DateUtil;
 import com.lantone.qc.pub.util.StringUtil;
@@ -54,6 +56,37 @@ public class THR0125 extends QCCatalogue {
             }
         }
 
+        //病案首页
+        if (inputInfo.getFirstPageRecordDoc() != null) {
+            Map<String, String> firstPagestructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            String directorDoctor = firstPagestructureMap.get("主任医师");
+            if (StringUtil.isNotBlank(directorDoctor)) {
+                //首次病程录
+                if (inputInfo.getFirstCourseRecordDoc() != null) {
+                    Map<String, String> firstCourseRecordStructureMap = inputInfo.getFirstCourseRecordDoc().getStructureMap();
+                    String doctorSign = firstCourseRecordStructureMap.get("记录医生");
+                    if (StringUtil.isNotBlank(doctorSign) && doctorSign.contains(directorDoctor)) {
+                        status.set("0");
+                        return;
+                    }
+                }
+
+                //术前小结
+                if (inputInfo.getOperationDocs() != null && inputInfo.getOperationDocs().size() > 0) {
+                    //取第一个术前小结
+                    PreoperativeDiscussionDoc preoperativeDiscussionDoc = inputInfo.getOperationDocs().get(0).getPreoperativeDiscussionDoc();
+                    if (preoperativeDiscussionDoc != null) {
+                        Map<String, String> preoperativeDiscussionStructureMap = preoperativeDiscussionDoc.getStructureMap();
+                        String doctorSign = preoperativeDiscussionStructureMap.get("记录医生");
+                        if (StringUtil.isNotBlank(doctorSign) && doctorSign.contains(directorDoctor)) {
+                            status.set("0");
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+
         if (inputInfo.getBeHospitalizedDoc() != null) {
             Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
             String admisTime = beHospitalStructureMap.get("入院日期");

+ 16 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xiamen/threelevelward/THR0126.java

@@ -10,6 +10,7 @@ import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.doc.MedicalRecordInfoDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.model.doc.ward.AttendingDoctorWardDoc;
+import com.lantone.qc.pub.model.doc.ward.DirectorDoctorWardDoc;
 import com.lantone.qc.pub.util.DateUtil;
 import com.lantone.qc.pub.util.SpringContextUtil;
 import com.lantone.qc.pub.util.StringUtil;
@@ -21,7 +22,7 @@ import java.util.Map;
 
 /**
  * @ClassName : THR0126
- * @Description : 主治医师首次查房未在48小时内完成
+ * @Description : 主治以上职称医师首次查房未在患者入院48小时内完成
  * @Author : 胡敬
  * @Date: 2020-03-19 15:50
  */
@@ -95,6 +96,11 @@ public class THR0126 extends QCCatalogue {
             }
             ThreeLevelWardDoc threeLevelWardDoc = inputInfo.getThreeLevelWardDocs().get(0);
             List<AttendingDoctorWardDoc> attendingDoctorWardDocs = threeLevelWardDoc.getAttendingDoctorWardDocs();
+            List<DirectorDoctorWardDoc> directorDoctorWardDocs = threeLevelWardDoc.getDirectorDoctorWardDocs();
+            //没有主治医师,主任医师查房,若入院时间和系统当前时间对比,相差48小时则报错
+            if (attendingDoctorWardDocs.size() == 0 && directorDoctorWardDocs.size() == 0 && CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), new Date(), 48 * 60L)) {
+                return;
+            }
             if (attendingDoctorWardDocs.size() > 0) {
                 AttendingDoctorWardDoc firstAttending = attendingDoctorWardDocs.get(0);
                 String wardDateStr = firstAttending.getStructureMap().get("查房日期");
@@ -102,9 +108,15 @@ public class THR0126 extends QCCatalogue {
                     status.set("0");
                     return;
                 }
-            } else if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), new Date(), 48 * 60L)) {
-                status.set("0");//没有主治医师查房,若入院时间和系统当前时间对比,相差48小时则报错
-                return;
+            }
+
+            if (directorDoctorWardDocs.size() > 0) {
+                DirectorDoctorWardDoc directorDoctorWardDoc = directorDoctorWardDocs.get(0);
+                String wardDateStr = directorDoctorWardDoc.getStructureMap().get("查房日期");
+                if (!CatalogueUtil.compareTime(StringUtil.parseDateTime(admisTime), StringUtil.parseDateTime(wardDateStr), 48 * 60L)) {
+                    status.set("0");
+                    return;
+                }
             }
 
             /* 如果存在手术记录,判断主刀医生是否为主治医生 */

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

@@ -0,0 +1,180 @@
+package com.lantone.qc.kernel.catalogue.hospital.xiamen.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 = "";
+        //主治医师
+        String attendingDoctor = "";
+        //住院医师
+        String hospitalizationDoctor = "";
+        int num = 0;
+        //病案首页
+        if (inputInfo.getFirstPageRecordDoc() != null) {
+            Map<String, String> firstPagestructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            attendingDoctor = firstPagestructureMap.get("主治医师");
+            hospitalizationDoctor = firstPagestructureMap.get("住院医师");
+        }
+        for (OperationDoc operationDoc : operationDocs) {
+            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+            if (operationRecordDoc == null) {
+                continue;
+            }
+            Map<String, String> structureMap = operationRecordDoc.getStructureMap();
+            String opeAssName = structureMap.get("手术者及助手名称");
+            if (StringUtil.isNotBlank(opeAssName)) {
+                split = opeAssName.split("、");
+                firstAssistant = structureMap.get("助手");
+                opeEndTime = structureMap.get("手术结束时间");
+            } else {
+                firstAssistant = structureMap.get("一助");
+                //取得手术时间截取结束时间(格式 2020-07-24 10:30-2020-07-24 11:45)
+                String key = getKeyByHospitalId();
+                opeEndTime = structureMap.get(key);
+                opeEndTime = getTime(opeEndTime, structureMap);
+            }
+            String chiefSurgeon = structureMap.get("主刀医师");
+
+            //手术记录中的术者如果和病案首页中的主治医师/住院医师是同一个人,那么本次手术不需要判断术前查房和术后24查房两个条目
+            if (num == 0 && StringUtil.isNotBlank(attendingDoctor) && StringUtil.isNotBlank(chiefSurgeon) && chiefSurgeon.contains(attendingDoctor)) {
+                return;
+            }
+            if (num == 0 && StringUtil.isNotBlank(hospitalizationDoctor) && StringUtil.isNotBlank(chiefSurgeon) && chiefSurgeon.contains(hospitalizationDoctor)) {
+                return;
+            }
+            num++;
+            if (opeEndTime.contains("年月日")) {
+                continue;
+            }
+            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;
+                    }
+                }
+            }
+        }
+    }
+
+    private String getTime(String opeEndTime, Map<String, String> structureMap) {
+        String time = "";
+        switch (Content.hospital_Id) {
+            case "7":               //厦门
+                if (StringUtil.isBlank(opeEndTime)) {
+                }
+                String endTime = structureMap.get("结束时间");
+                if (StringUtil.isNotBlank(endTime)) {
+                    if (endTime.length() > 5) {
+                        time = opeEndTime.substring(0, Math.min(5, opeEndTime.length())) + endTime;
+                    } else {
+                        time = opeEndTime + " " + endTime;
+                    }
+                }
+                return time;
+            default:
+                time = opeEndTime.substring(17);
+                return time;
+        }
+    }
+
+    private String getKeyByHospitalId() {
+        switch (Content.hospital_Id) {
+            case "7":               //厦门
+                return "病历日期";
+            default:
+                return "记录时间";
+        }
+    }
+}

+ 39 - 25
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xiamen/threelevelward/THR03010.java

@@ -5,6 +5,8 @@ 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.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
+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.apache.commons.lang3.time.DateUtils;
@@ -18,27 +20,32 @@ import java.util.Map;
 
 /**
  * @author wangfeng
- * @Description:入院后没有连续记录3天
- * 记录分为:首次病程记录+查房记录
+ * @Description:入院后没有连续记录3天 记录分为:首次病程记录+查房记录
  * @date 2020-06-29 17:16
  */
 @Component
 public class THR03010 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        //住院病例信息为空,终止
         if (inputInfo.getMedicalRecordInfoDoc() == null || inputInfo.getMedicalRecordInfoDoc().getStructureMap().size() == 0) {
             return;
         }
         if (inputInfo.getFirstPageRecordDoc() == null || inputInfo.getFirstPageRecordDoc().getStructureMap().size() == 0) {
             return;
         }
+        //获取入院记录文档集合
         Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        //入院日期为空前面就是入院日期,入院日期不为空 前面就为空
         String behospitalDate = structureMap.get("入院日期") == null ? null : structureMap.get("入院日期");
         //String leaveHospitalDate = structureMap.get("leaveHospitalDate") == null ? null : structureMap.get("leaveHospitalDate");
+        //获取病案首页文档集合
         Map<String, String> structureMaps = inputInfo.getFirstPageRecordDoc().getStructureMap();
-        String leaveHospitalDate = structureMaps.get("出院时间")!= null ?
-                structureMaps.get("出院时间") :inputInfo.getMedicalRecordInfoDoc().getStructureMap().get("leaveHospitalDate");
+        //离开医院时间为如果出院时间不为空,则离开医院时间为出院时间,如果出院时间为空,则离开医院时间为住院病例信息集合中的离开医院日期
+        String leaveHospitalDate = structureMaps.get("出院时间") != null ?
+                structureMaps.get("出院时间") : inputInfo.getMedicalRecordInfoDoc().getStructureMap().get("leaveHospitalDate");
         if (behospitalDate != null && leaveHospitalDate != null) {
+            //解析时间
             Date beDate = StringUtil.parseDateTime(behospitalDate);
             Date leaveDate = StringUtil.parseDateTime(leaveHospitalDate);
             long l = (leaveDate.getTime() - beDate.getTime()) / (24 * 60 * 60 * 1000);
@@ -49,6 +56,7 @@ public class THR03010 extends QCCatalogue {
                 //从住院开始连续的时间列表
                 List<Date> stringDate = new ArrayList<>();
                 //当天算进去所以从零开始
+                //获取从当天开始的后三天日期时 分 秒
                 for (int i = 0; i < 4; i++) {
                     stringDate.add(DateUtil.getFirstTimeOfDay(DateUtil.addDay(beDate, i)));
                 }
@@ -57,11 +65,10 @@ public class THR03010 extends QCCatalogue {
                 List<Date> wordDateList = new ArrayList<>();
                 //获取首次病程记录时间
                 FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
-                if(firstCourseRecordDoc!=null
-                        &&StringUtil.isNotBlank(firstCourseRecordDoc.getStructureMap().get("病历日期"))) {
+                if (firstCourseRecordDoc != null
+                        && StringUtil.isNotBlank(firstCourseRecordDoc.getStructureMap().get("病历日期"))) {
                     String firstCourseRecorTime = firstCourseRecordDoc.getStructureMap().get("病历日期");
-                    if(StringUtil.isNotBlank(firstCourseRecorTime))
-                    {
+                    if (StringUtil.isNotBlank(firstCourseRecorTime)) {
                         wordDateList.add(StringUtil.parseDateTime(firstCourseRecorTime));
                     }
                 }
@@ -70,26 +77,36 @@ public class THR03010 extends QCCatalogue {
                 for (ThreeLevelWardDoc t : threeLevelWardDocs) {
                     Date threeLevelDate = StringUtil.parseDateTime(t.getStructureMap().get("查房日期"));
                     //去重,同一天就存一次
-                    if(threeLevelDate!=null&&wordDateList.get(wordDateList.size()-1)!=null
-                            &&!DateUtils.isSameDay(wordDateList.get(wordDateList.size()-1),threeLevelDate))
-                    {
+                    if (threeLevelDate != null && wordDateList.get(wordDateList.size() - 1) != null
+                            && !DateUtils.isSameDay(wordDateList.get(wordDateList.size() - 1), threeLevelDate)) {
                         wordDateList.add(threeLevelDate);
                     }
                 }
+
+                //获取手术首次病程录时间
+                List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+                if (operationDocs != null) {
+                    for (OperationDoc t : operationDocs) {
+                        OperationDiscussionDoc operationDiscussionDoc = t.getOperationDiscussionDoc();
+                        if (operationDiscussionDoc != null) {
+                            Date firstOperationtime = StringUtil.parseDateTime(operationDiscussionDoc.getStructureMap().get("病历日期"));
+                            if (firstOperationtime != null) {
+                                wordDateList.add(firstOperationtime);
+                            }
+                        }
+                    }
+                }
+
                 //如果记录时间没有3天
-                if(wordDateList.size()<3)
-                {
+                if (wordDateList.size() < 3) {
                     status.set("-1");
                     return;
                 }
                 //如果住院当天开始做记录
-                if(DateUtils.isSameDay(stringDate.get(0),wordDateList.get(0)))
-                {
-                    for(int i = 1;i<=2;i++)
-                    {
+                if (DateUtils.isSameDay(stringDate.get(0), wordDateList.get(0))) {
+                    for (int i = 1; i <= 2; i++) {
                         //如果时间不相等则时间不连续
-                        if(!DateUtils.isSameDay(stringDate.get(i),wordDateList.get(i)))
-                        {
+                        if (!DateUtils.isSameDay(stringDate.get(i), wordDateList.get(i))) {
                             status.set("-1");
                             return;
                         }
@@ -97,13 +114,10 @@ public class THR03010 extends QCCatalogue {
                     return;
                 }
                 //如果是住院后第二天开始
-                else
-                {
-                    for(int i = 0;i<=3;i++)
-                    {
+                else {
+                    for (int i = 0; i <= 3; i++) {
                         //如果时间不相等则时间不连续
-                        if(!DateUtils.isSameDay(stringDate.get(i+1),wordDateList.get(i)))
-                        {
+                        if (!DateUtils.isSameDay(stringDate.get(i + 1), wordDateList.get(i))) {
                             status.set("-1");
                             return;
                         }

+ 209 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/xszyy/threelevelward/THR03116.java

@@ -0,0 +1,209 @@
+package com.lantone.qc.kernel.catalogue.hospital.xszyy.threelevelward;
+
+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.*;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+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.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @ClassName : THE03116
+ * @Description: 病理检查缺少病理检查报告单
+ * @author: 贺聪聪
+ * @time: 2022/05/25 14:49
+ */
+
+@Component
+public class THR03116 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        boolean flag = false;
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        List<PacsDoc> pacsDocs = inputInfo.getPacsDocs();
+        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        //去医嘱
+        if (ListUtil.isNotEmpty(doctorAdviceDocs)) {
+            for (DoctorAdviceDoc dad : doctorAdviceDocs) {
+                Map<String, String> dadStructureMap = dad.getStructureMap();
+                String daStatus = dadStructureMap.get(Content.doctorAdviceState);
+                if (StringUtil.isNotEmpty(daStatus)) {
+                    if (!Content.cancellationOrderList.contains(daStatus)) {
+                        String adviceType = dadStructureMap.get(Content.doctorAdviceType);
+                        //取临时医嘱
+                        if (StringUtil.isNotEmpty(adviceType) && adviceType.equals(Content.statOrder)) {
+                            String name = dadStructureMap.get(Content.medicalOrderName);
+                            if (exStr(name)) {
+                                flag = true;
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        //用首页判断是否进行了病理检查
+        if(firstPageRecordDoc!=null){
+            String str = firstPageRecordDoc.getStructureMap().get("病理诊断费");
+            if ( !str.equals("0") && StringUtil.isNotEmpty(str)) {
+                double a = Double.parseDouble(str);
+                if ( a > Content.pathologicalFee) {
+                    flag=true;
+                }
+            }
+        }
+        //手术记录
+        if(ListUtil.isNotEmpty(operationDocs)){
+            for (OperationDoc operationDoc : operationDocs) {
+                OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+                if(operationRecordDoc!=null) {
+                    String str = operationRecordDoc.getStructureMap().get("手术经过及处理");
+                    if (StringUtil.isNotEmpty(str)) {
+                        if (ssBlStr(str)) {
+                            flag = true;
+                        }
+                    }
+                }
+            }
+        }
+        List<PathologyShipDoc> pathologyShipDocs = inputInfo.getPathologyShipDocs();
+        if(ListUtil.isNotEmpty(pathologyShipDocs)){
+            flag=true;
+        }
+        if (flag) {
+            status.set("-1");
+            if (ListUtil.isNotEmpty(pacsDocs)) {
+                for (PacsDoc pacsDoc : pacsDocs) {
+                    Map<String, String> structureMap = pacsDoc.getStructureMap();
+                    String str = structureMap.get("检查所见");
+                    String str1 = structureMap.get("临床诊断");
+                    String str2 = structureMap.get("报告名称");
+                    String str3 = structureMap.get("观察记录");
+                    String str4 = structureMap.get("检查结果诊断");
+                    String str5 = structureMap.get("检查部位");
+                    if(dateStr(str)||dateStr(str1)||dateStr(str2)||dateStr(str3)||dateStr(str4)||str5.contains("病理")){
+                        status.set("0");
+                        return;
+                    }
+                }
+            }
+        }
+    }
+    private boolean dateStr(String string){
+        if(StringUtil.isEmpty(string)){
+            return false;
+        }
+        boolean flag=false;
+        String str = Str(string);
+        String rex="[\\s\\S]*(?=流式)[\\s\\S]*";
+        String rex1="[\\s\\S]*(?=穿透)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
+        String rex2="[\\s\\S]*(?=癌)[^,;,;。]{0,7}(?=浸润)[\\s\\S]*";
+        String rex3="[\\s\\S]*(?=分化)[\\s\\S]*";
+        String rex4="[\\s\\S]*(?=淋巴结)[^,;,;。]{0,8}(?=转移)[\\s\\S]*";
+        String rex5="[\\s\\S]*(?=浸润性)[^,;,;。]{0,8}(?=癌)[\\s\\S]*";
+        String rex6="[\\s\\S]*(?=突破)[^,;,;。]{0,7}(?=层)[\\s\\S]*";
+        List<String> reportCardPathologyList = Content.reportCardPathologyList;
+        for (String reportCardPathology : reportCardPathologyList) {
+            if(string.contains(reportCardPathology)){
+                flag=true;
+            }
+        }
+        if(flag || str.matches(rex1)|| str.matches(rex2)
+                ||str.matches(rex3)|| str.matches(rex4)||str.matches(rex5)|| str.matches(rex6)|| str.matches(rex)){
+            return true;
+        }
+        return false;
+    }
+    private boolean ssBlStr(String string){
+        if(StringUtil.isEmpty(string)){
+            return false;
+        }
+        List<String> surgeryPathologyTwoList = Content.surgeryPathologyTwoList;
+        for (String surgeryPathologyTwo : surgeryPathologyTwoList) {
+            if(string.contains(surgeryPathologyTwo)){
+                return true;
+            }
+        }
+        String str = Str(string);
+        if(str.contains("冰冻")){
+            if(bdStr(str)){
+                return true;
+            }
+        }
+        return false;
+    }
+    private boolean exStr(String string){
+        if(StringUtil.isEmpty(string)){
+            return false;
+        }
+        String str = Str(string);
+        List<String> doctorAdvicePathologyList = Content.doctorAdvicePathologyList;
+        for (String doctorAdvicePathology : doctorAdvicePathologyList) {
+            if(string.contains(doctorAdvicePathology)){
+                return true;
+            }
+        }
+        if(str.contains("冰冻")){
+            if(bdStr(str)){
+                return true;
+            }
+        }
+        return false;
+    }
+    private String Str(String str){
+        str = str.replaceAll("\\*", "\\\\*");
+        str = str.replaceAll("\\)", "\\\\)");
+        str = str.replaceAll("\\.", "\\\\.");
+        str = str.replaceAll("\\?", "\\\\?");
+        str = str.replaceAll("\\+", "\\\\+");
+        str = str.replaceAll("\\$", "\\\\$");
+        str = str.replaceAll("\\^", "\\\\^");
+        str = str.replaceAll("\\[", "\\\\[");
+        str = str.replaceAll("\\]", "\\\\]");
+        str = str.replaceAll("\\(", "\\\\(");
+        str = str.replaceAll("\\{", "\\\\{");
+        str = str.replaceAll("\\}", "\\\\}");
+        str = str.replaceAll("\\|", "\\\\|");
+        str = str.replaceAll("\\/", "\\\\/");
+        return str;
+    }
+    //判断包含冰冻但不属于病理
+    private boolean bdStr(String str) {
+        ArrayList<String> blStrings = new ArrayList<>();
+        String rex1="[\\s\\S]{0,10}(?=冰冻)[\\s\\S]{0,10}";
+        Matcher matcher = Pattern.compile(rex1).matcher(str);
+        while (matcher.find()) {
+            String group = matcher.group();
+            blStrings.add(group);
+        }
+        List<String> notBLList = Content.notBDBLList;
+        if (ListUtil.isNotEmpty(blStrings)) {
+            for (String notBL : notBLList) {
+                for (int i = 0; i < blStrings.size(); i++) {
+                    String cfStr = blStrings.get(i);
+                    if (cfStr.contains(notBL)) {
+                        blStrings.remove(i);
+                        continue;
+                    }
+                }
+            }
+            if (blStrings.size() > 0) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

+ 70 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE03235.java

@@ -0,0 +1,70 @@
+package com.lantone.qc.kernel.catalogue.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.LeaveHospitalDoc;
+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.text.ParseException;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 贺聪聪
+ * @Description: 手术记录中手术日期填写错误
+ * @data 2022/5/24  10:42
+ */
+@Component
+public class OPE03235 extends QCCatalogue {
+    @Override
+    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
+        status.set("0");
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        if (operationDocs == null || operationDocs.size() == 0) {
+            return;
+        }
+        if (leaveHospitalDoc != null) {
+            for (OperationDoc operationDoc : operationDocs) {
+                OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+                if (operationRecordDoc == null) {
+                    return;
+                }
+                Map<String, String> structureMap = operationRecordDoc.getStructureMap();
+                String operationDayStr = structureMap.get("手术日期");
+                if (StringUtil.isBlank(operationDayStr)) {
+                    continue;
+                }
+                String operationDatesStr = operationDayStr.substring(0,10);//截取手术日期
+                String operationTimeStr = structureMap.get("开始时间").substring(0,5);//截取开始时间
+                String operationDateStr = operationDatesStr + " " + operationTimeStr;//拼接
+
+                String beginDateStr = leaveHospitalDoc.getStructureMap().get("入院日期");
+                String endDateStr = leaveHospitalDoc.getStructureMap().get("出院时间");
+                if (StringUtil.isBlank(beginDateStr) || StringUtil.isBlank(endDateStr) || StringUtil.isBlank(operationDateStr)) {
+                    return;
+                }
+                Date beginDate = StringUtil.parseDateTime(beginDateStr);
+                Date endDate = StringUtil.parseDateTime(endDateStr);
+                Date operationDate = StringUtil.parseDateTime(operationDateStr);
+
+                if (operationDate.before(beginDate) || operationDate.after(endDate)) {
+                    status.set("-1");
+                    return;
+                } else {
+                    return;
+                }
+            }
+        }
+    }
+}
+
+
+
+
+

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

@@ -50,6 +50,13 @@ public class OPE0351 extends QCCatalogue {
                         && (operationDoc.getOperationDiscussionDoc().getText().contains("°C")
                         || operationDoc.getOperationDiscussionDoc().getText().contains("次/分")
                         || operationDoc.getOperationDiscussionDoc().getText().contains("mmHg")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("体温")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("脉搏")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("呼吸")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("血压")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("血氧")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("瞳孔")
+                        || operationDoc.getOperationDiscussionDoc().getText().contains("角膜反射")
                 )) {
                     flag = true;
                 }

+ 3 - 0
trans/src/main/java/com/lantone/qc/trans/xszyy/BeiLunFirstPageRecordDocTrans.java

@@ -8,6 +8,7 @@ import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.xszyy.util.comsis.XszyyCommonAnalysisUtil;
 
 import java.util.HashMap;
 import java.util.Iterator;
@@ -24,11 +25,13 @@ public class BeiLunFirstPageRecordDocTrans extends ModelDocTrans {
     @Override
     public FirstPageRecordDoc extract(MedrecVo medrecVo) {
         Map<String, String> content = (Map) medrecVo.getContent();
+        content.put("姓名", XszyyCommonAnalysisUtil.extracReplace(content.get("姓名")));
         FirstPageRecordDoc firstPageRecordDoc = new FirstPageRecordDoc();
         firstPageRecordDoc.setStructureMap(content);
 
         Map<String, Object> structureExtMap = Maps.newHashMap();
         structureExtMap.putAll(content);
+        structureExtMap.put("姓名", XszyyCommonAnalysisUtil.extracReplace(content.get("姓名")));
         structureExtMap.put(Content.diagnose_cts, FastJsonUtils.getJsonToBean(content.get(Content.diagnose_cts), Object.class));
         //        structureExtMap.put(Content.outpatientEmergencyDiag, FastJsonUtils.getJsonToBean(content.get(Content.outpatientEmergencyDiag), Object.class));
         structureExtMap.put(Content.operative_information, FastJsonUtils.getJsonToBean(content.get(Content.operative_information), Object.class));

+ 11 - 0
trans/src/main/java/com/lantone/qc/trans/xszyy/util/BeiLunBeHospitalizedHtmlAnalysis.java

@@ -60,11 +60,22 @@ public class BeiLunBeHospitalizedHtmlAnalysis implements BeiLunHtmlAnalysis {
             //有冒号版本
             XszyyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,map);
         }
+        //拆分发病节气后面的病案号
+        if (map.containsKey("发病节气")){
+            map.put("病案号",map.get("发病节气").substring(map.get("发病节气").indexOf("病"),map.get("发病节气").indexOf(map.get("发病节气").charAt((map.get("发病节气").length()-1)))+1));
+            map.put("发病节气",map.get("发病节气").substring(0,map.get("发病节气").indexOf(map.get("病案号"))));
+            map.put("病案号",map.get("病案号").substring(map.get("发病节气").length(),map.get("病案号").length()));
+        }
         //书写医生中包含书写时间
         if(map.containsKey("书写医生")&&XszyyCommonAnalysisUtil.extractDate(map.get("书写医生"))!=null){
             map.put("书写时间",XszyyCommonAnalysisUtil.extractDate(map.get("书写医生")));
             map.put("书写医生",map.get("书写医生").substring(0,map.get("书写医生").indexOf(map.get("书写时间"))));
         }
+        //去掉所有空格
+        if(map.containsKey("姓名")&&map.get("姓名").length()>2){
+            map.put("姓名",XszyyCommonAnalysisUtil.extracReplace(map.get("姓名")));
+        }
+
         if(map.containsKey("医师签名")&&XszyyCommonAnalysisUtil.extractDate(map.get("医师签名"))!=null){
             map.put("书写时间",XszyyCommonAnalysisUtil.extractDate(map.get("医师签名")));
             map.put("书写医生",map.get("医师签名").substring(0,map.get("医师签名").indexOf(map.get("书写时间"))));

+ 9 - 0
trans/src/main/java/com/lantone/qc/trans/xszyy/util/comsis/XszyyCommonAnalysisUtil.java

@@ -302,6 +302,15 @@ public class XszyyCommonAnalysisUtil {
         return null;
     }
 
+    /**
+     * 去掉字符串中的空格
+     * @param top
+     * @return
+     */
+    public static String extracReplace(String top) {
+        String replaceAll = top.replaceAll(" +", "");
+        return replaceAll;
+    }
     /**
      * 宁波中医院抽取文本中的第一个时间
      *