浏览代码

宁波镇海规则

zhaops 3 年之前
父节点
当前提交
8cb64e2157

+ 5 - 5
kernel/src/main/java/com/lantone/qc/kernel/catalogue/clinicalblood/CLI0304.java

@@ -8,6 +8,7 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.ClinicalBloodDoc;
 import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+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;
@@ -50,7 +51,6 @@ public class CLI0304 extends QCCatalogue {
             return;
         }
 
-        String[] dateFormats = new String[]{"yyyy年MM月dd日", "yyyy-MM-dd", "yyyy-MM-dd"};
         String regex1 = "输血前检查|术前三项|术前四项|感染四项|输血前四项";
         String regex2 = "乙[\\u4E00-\\u9FA5A-Za-z]{0,}肝";
         String regex3 = "丙[\\u4E00-\\u9FA5A-Za-z]{0,}肝";
@@ -110,7 +110,7 @@ public class CLI0304 extends QCCatalogue {
                 List<Date> cBDateList = clinicalBloodDocs.stream()
                         .filter(Objects::nonNull)
                         .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("病历日期")))
-                        .map(i -> StringUtil.parseDateTime(i.getStructureMap().get("病历日期"), dateFormats))
+                        .map(i -> DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("病历日期"))))
                         .sorted((Comparator.comparing(i -> i)))
                         .collect(Collectors.toList());
 
@@ -118,7 +118,7 @@ public class CLI0304 extends QCCatalogue {
                 List<Date> daDateList = filterDAList.stream()
                         .filter(Objects::nonNull)
                         .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱开始时间")))
-                        .map(i -> StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"), dateFormats))
+                        .map(i -> DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"))))
                         .sorted((Comparator.comparing(i -> i)))
                         .collect(Collectors.toList());
 
@@ -176,7 +176,7 @@ public class CLI0304 extends QCCatalogue {
                     List<Date> cBDateList = clinicalBloodDAList.stream()
                             .filter(Objects::nonNull)
                             .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱开始时间")))
-                            .map(i -> StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"), dateFormats))
+                            .map(i -> DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"))))
                             .sorted((Comparator.comparing(i -> i)))
                             .collect(Collectors.toList());
 
@@ -184,7 +184,7 @@ public class CLI0304 extends QCCatalogue {
                     List<Date> daDateList = filterDAList.stream()
                             .filter(Objects::nonNull)
                             .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱开始时间")))
-                            .map(i -> StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"), dateFormats))
+                            .map(i -> DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("医嘱开始时间"))))
                             .sorted((Comparator.comparing(i -> i)))
                             .collect(Collectors.toList());
 

+ 19 - 34
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03233.java

@@ -11,11 +11,16 @@ import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
+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.*;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -89,43 +94,23 @@ public class THR03233 extends QCCatalogue {
             return;
         }
 
-        String[] dateFormats = new String[]{"yyyy年MM月dd日", "yyyy-MM-dd", "yyyy-MM-dd"};
-
-        /*List<Date> dateList = date.stream().map(i -> {
-                    try {
-                        return (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(i);
-                    } catch (ParseException e) {
-                        e.printStackTrace();
-                    }
-                    return null;
-                })
-                .filter(Objects::nonNull)
-                .sorted(Comparator.comparing(i -> i))
-                .collect(Collectors.toList());*/
-        List<Date> dateList = date.stream().map(i -> StringUtil.parseDateTime(i, dateFormats))
+        List<Date> dateList = date.stream().map(i -> StringUtil.parseDateTime(i))
                 .filter(Objects::nonNull)
                 .sorted(Comparator.comparing(i -> i))
                 .collect(Collectors.toList());
 
-        Calendar c1 = Calendar.getInstance();
-        c1.setTime(dateList.get(0));
-        c1.add(Calendar.DAY_OF_MONTH, -1);
-        Calendar c2 = Calendar.getInstance();
-        c1.setTime(dateList.get(dateList.size() - 1));
-        c1.add(Calendar.DAY_OF_MONTH, 2);
-
-        Date startDate = c1.getTime();
-        Date endDate = c2.getTime();
+        Date startDate = DateUtil.getFirstTimeOfDay(DateUtil.addDate(dateList.get(0), -1));
+        Date endDate = DateUtil.getFirstTimeOfDay(DateUtil.addDate(dateList.get(dateList.size() - 1), 2));
 
         String regex = "四诊|神色|神态|面色|形态|语声|气息|舌象|舌|苔|脉|血虚|气血";
 
         //首次诊疗计划
         if (null != firstCourseRecordDoc) {
             String treatPlan = firstCourseRecordDoc.getStructureMap().get("诊疗计划");
-            Date treatPlanDate = StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("病历日期"), dateFormats);
+            Date treatPlanDate = DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("病历日期")));
             if (StringUtil.isNotBlank(treatPlan)
-                    && treatPlanDate.after(startDate)
-                    && treatPlanDate.before(endDate)
+                    && (!treatPlanDate.after(startDate)
+                    || !treatPlanDate.before(endDate))
                     && RegexUtil.getRegexRes(treatPlan, regex, 2)) {
                 status.set("0");
                 return;
@@ -142,8 +127,8 @@ public class THR03233 extends QCCatalogue {
             threeLevelWardDocs = threeLevelWardDocs.stream()
                     .filter(Objects::nonNull)
                     .filter(i -> i.getStructureMap().containsKey("查房日期") && i.getStructureMap().containsKey("病情记录"))
-                    .filter(i -> StringUtil.parseDateTime(i.getStructureMap().get("查房日期"), dateFormats).after(startDate)
-                            && StringUtil.parseDateTime(i.getStructureMap().get("查房日期"), dateFormats).before(endDate))
+                    .filter(i -> !DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("查房日期"))).after(startDate)
+                            || !DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("查房日期"))).before(endDate))
                     .collect(Collectors.toList());
             if (ListUtil.isNotEmpty(threeLevelWardDocs)) {
                 for (ThreeLevelWardDoc item : threeLevelWardDocs) {
@@ -153,7 +138,7 @@ public class THR03233 extends QCCatalogue {
                     }
 
                     //todo 模型记录四诊(暂不处理)
-                    //List<ThreeLevelWardLabel> threeLevelWardLabel = item.getThreeLevelWardLabel();
+                    List<ThreeLevelWardLabel> threeLevelWardLabel = item.getThreeLevelWardLabel();
                 }
             }
         }
@@ -161,10 +146,10 @@ public class THR03233 extends QCCatalogue {
         //出院小结
         if (null != leaveHospitalDoc) {
             String leaveHosText = leaveHospitalDoc.getStructureMap().get("出院医嘱");
-            Date leaveHospitalDate = StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("出院日期"), dateFormats);
+            Date leaveHospitalDate = DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("出院日期")));
             if (StringUtil.isNotBlank(leaveHosText)
-                    && leaveHospitalDate.after(startDate)
-                    && leaveHospitalDate.before(endDate)
+                    && (!leaveHospitalDate.after(startDate)
+                    || !leaveHospitalDate.before(endDate))
                     && RegexUtil.getRegexRes(leaveHosText, regex, 2)) {
                 status.set("0");
                 return;
@@ -179,4 +164,4 @@ public class THR03233 extends QCCatalogue {
         status.set("-1");
         return;
     }
-}
+}

+ 21 - 26
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03234.java

@@ -11,11 +11,15 @@ import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+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.*;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -45,12 +49,12 @@ public class THR03234 extends QCCatalogue {
             return;
         }
 
-        doctorAdviceDocs=doctorAdviceDocs.stream()
+        doctorAdviceDocs = doctorAdviceDocs.stream()
                 .filter(Objects::nonNull)
-                .filter(i->StringUtil.isNotBlank(i.getStructureMap().get("医嘱处方类型"))
-                        &&(i.getStructureMap().get("医嘱处方类型").equals("药品")))
-                .filter(i->StringUtil.isNotBlank(i.getStructureMap().get("药品类型"))
-                        &&(i.getStructureMap().get("药品类型").equals("普药")||i.getStructureMap().get("药品类型").equals("中药")))
+                .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱处方类型"))
+                        && (i.getStructureMap().get("医嘱处方类型").equals("药品")))
+                .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("药品类型"))
+                        && (i.getStructureMap().get("药品类型").equals("普药") || i.getStructureMap().get("药品类型").equals("中药")))
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(doctorAdviceDocs)) {
             status.set("0");
@@ -87,32 +91,23 @@ public class THR03234 extends QCCatalogue {
             return;
         }
 
-        String[] dateFormats = new String[]{"yyyy年MM月dd日", "yyyy-MM-dd", "yyyy-MM-dd"};
-
-        List<Date> dateList = date.stream().map(i -> StringUtil.parseDateTime(i, dateFormats))
+        List<Date> dateList = date.stream().map(i -> StringUtil.parseDateTime(i))
                 .filter(Objects::nonNull)
                 .sorted(Comparator.comparing(i -> i))
                 .collect(Collectors.toList());
 
-        Calendar c1 = Calendar.getInstance();
-        c1.setTime(dateList.get(0));
-        c1.add(Calendar.DAY_OF_MONTH, -1);
-        Calendar c2 = Calendar.getInstance();
-        c1.setTime(dateList.get(dateList.size() - 1));
-        c1.add(Calendar.DAY_OF_MONTH, 2);
-
-        Date startDate = c1.getTime();
-        Date endDate = c2.getTime();
+        Date startDate = DateUtil.getFirstTimeOfDay(DateUtil.addDate(dateList.get(0), -1));
+        Date endDate = DateUtil.getFirstTimeOfDay(DateUtil.addDate(dateList.get(dateList.size() - 1), 2));
 
         String regex = "中医辨病辨证依据|中医辩证";
 
         //首次诊疗计划
         if (null != firstCourseRecordDoc) {
             String treatPlan = firstCourseRecordDoc.getStructureMap().get("诊疗计划");
-            Date treatPlanDate = StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("病历日期"), dateFormats);
+            Date treatPlanDate = DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("病历日期")));
             if (StringUtil.isNotBlank(treatPlan)
-                    && treatPlanDate.after(startDate)
-                    && treatPlanDate.before(endDate)
+                    && (!treatPlanDate.after(startDate)
+                    || !treatPlanDate.before(endDate))
                     && RegexUtil.getRegexRes(treatPlan, regex, 2)) {
                 status.set("0");
                 return;
@@ -124,8 +119,8 @@ public class THR03234 extends QCCatalogue {
             threeLevelWardDocs = threeLevelWardDocs.stream()
                     .filter(Objects::nonNull)
                     .filter(i -> i.getStructureMap().containsKey("查房日期") && i.getStructureMap().containsKey("病情记录"))
-                    .filter(i -> StringUtil.parseDateTime(i.getStructureMap().get("查房日期"), dateFormats).after(startDate)
-                            && StringUtil.parseDateTime(i.getStructureMap().get("查房日期"), dateFormats).before(endDate))
+                    .filter(i -> !DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("查房日期"))).after(startDate)
+                            || !DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("查房日期"))).before(endDate))
                     .collect(Collectors.toList());
             if (ListUtil.isNotEmpty(threeLevelWardDocs)) {
                 for (ThreeLevelWardDoc item : threeLevelWardDocs) {
@@ -140,10 +135,10 @@ public class THR03234 extends QCCatalogue {
         //出院小结
         if (null != leaveHospitalDoc) {
             String leaveHosText = leaveHospitalDoc.getStructureMap().get("出院医嘱");
-            Date leaveHospitalDate = StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("出院日期"), dateFormats);
+            Date leaveHospitalDate = DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("出院日期")));
             if (StringUtil.isNotBlank(leaveHosText)
-                    && leaveHospitalDate.after(startDate)
-                    && leaveHospitalDate.before(endDate)
+                    && (!leaveHospitalDate.after(startDate)
+                    || !leaveHospitalDate.before(endDate))
                     && RegexUtil.getRegexRes(leaveHosText, regex, 2)) {
                 status.set("0");
                 return;

+ 21 - 26
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03235.java

@@ -11,11 +11,15 @@ import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+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.*;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -45,12 +49,12 @@ public class THR03235 extends QCCatalogue {
             return;
         }
 
-        doctorAdviceDocs=doctorAdviceDocs.stream()
+        doctorAdviceDocs = doctorAdviceDocs.stream()
                 .filter(Objects::nonNull)
-                .filter(i->StringUtil.isNotBlank(i.getStructureMap().get("医嘱处方类型"))
-                        &&(i.getStructureMap().get("医嘱处方类型").equals("药品")))
-                .filter(i->StringUtil.isNotBlank(i.getStructureMap().get("药品类型"))
-                        &&(i.getStructureMap().get("药品类型").equals("药品")||i.getStructureMap().get("药品类型").equals("中药")))
+                .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱处方类型"))
+                        && (i.getStructureMap().get("医嘱处方类型").equals("药品")))
+                .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("药品类型"))
+                        && (i.getStructureMap().get("药品类型").equals("药品") || i.getStructureMap().get("药品类型").equals("中药")))
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(doctorAdviceDocs)) {
             status.set("0");
@@ -87,32 +91,23 @@ public class THR03235 extends QCCatalogue {
             return;
         }
 
-        String[] dateFormats = new String[]{"yyyy年MM月dd日", "yyyy-MM-dd", "yyyy-MM-dd"};
-
-        List<Date> dateList = date.stream().map(i -> StringUtil.parseDateTime(i, dateFormats))
+        List<Date> dateList = date.stream().map(i -> StringUtil.parseDateTime(i))
                 .filter(Objects::nonNull)
                 .sorted(Comparator.comparing(i -> i))
                 .collect(Collectors.toList());
 
-        Calendar c1 = Calendar.getInstance();
-        c1.setTime(dateList.get(0));
-        c1.add(Calendar.DAY_OF_MONTH, -1);
-        Calendar c2 = Calendar.getInstance();
-        c1.setTime(dateList.get(dateList.size() - 1));
-        c1.add(Calendar.DAY_OF_MONTH, 2);
-
-        Date startDate = c1.getTime();
-        Date endDate = c2.getTime();
+        Date startDate = DateUtil.getFirstTimeOfDay(DateUtil.addDate(dateList.get(0), -1));
+        Date endDate = DateUtil.getFirstTimeOfDay(DateUtil.addDate(dateList.get(dateList.size() - 1), 2));
 
         String regex = "治则|治为则|治法";
 
         //首次诊疗计划
         if (null != firstCourseRecordDoc) {
             String treatPlan = firstCourseRecordDoc.getStructureMap().get("诊疗计划");
-            Date treatPlanDate = StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("病历日期"), dateFormats);
+            Date treatPlanDate = DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("病历日期")));
             if (StringUtil.isNotBlank(treatPlan)
-                    && treatPlanDate.after(startDate)
-                    && treatPlanDate.before(endDate)
+                    && (!treatPlanDate.after(startDate)
+                    || !treatPlanDate.before(endDate))
                     && RegexUtil.getRegexRes(treatPlan, regex, 2)) {
                 status.set("0");
                 return;
@@ -124,8 +119,8 @@ public class THR03235 extends QCCatalogue {
             threeLevelWardDocs = threeLevelWardDocs.stream()
                     .filter(Objects::nonNull)
                     .filter(i -> i.getStructureMap().containsKey("查房日期") && i.getStructureMap().containsKey("病情记录"))
-                    .filter(i -> StringUtil.parseDateTime(i.getStructureMap().get("查房日期"), dateFormats).after(startDate)
-                            && StringUtil.parseDateTime(i.getStructureMap().get("查房日期"), dateFormats).before(endDate))
+                    .filter(i -> !DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("查房日期"))).after(startDate)
+                            || !DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("查房日期"))).before(endDate))
                     .collect(Collectors.toList());
             if (ListUtil.isNotEmpty(threeLevelWardDocs)) {
                 for (ThreeLevelWardDoc item : threeLevelWardDocs) {
@@ -140,10 +135,10 @@ public class THR03235 extends QCCatalogue {
         //出院小结
         if (null != leaveHospitalDoc) {
             String leaveHosText = leaveHospitalDoc.getStructureMap().get("出院医嘱");
-            Date leaveHospitalDate = StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("出院日期"), dateFormats);
+            Date leaveHospitalDate = DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("出院日期")));
             if (StringUtil.isNotBlank(leaveHosText)
-                    && leaveHospitalDate.after(startDate)
-                    && leaveHospitalDate.before(endDate)
+                    && (!leaveHospitalDate.after(startDate)
+                    || !leaveHospitalDate.before(endDate))
                     && RegexUtil.getRegexRes(leaveHosText, regex, 2)) {
                 status.set("0");
                 return;

+ 29 - 25
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03236.java

@@ -4,17 +4,20 @@ package com.lantone.qc.kernel.catalogue.threelevelward;
 import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.RegexUtil;
+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.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.util.DateUtil;
 import com.lantone.qc.pub.util.ListUtil;
-import com.lantone.qc.pub.util.PropertiesUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -48,7 +51,7 @@ public class THR03236 extends QCCatalogue {
         doctorAdviceDocs = doctorAdviceDocs.stream()
                 .filter(Objects::nonNull)
                 .filter(i -> StringUtil.isNotBlank(i.getStructureMap().get("医嘱处方类型"))
-                        && i.getStructureMap().get("医嘱处方类型").contains("药品"))
+                        && i.getStructureMap().get("医嘱处方类型").equals("药品"))
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(doctorAdviceDocs)) {
             status.set("0");
@@ -57,12 +60,22 @@ public class THR03236 extends QCCatalogue {
 
 
         String regex1 = "口服|静滴|静推";
-        List<String> chineseMedicine = Lists.newArrayList();
-        PropertiesUtil propertiesUtil = new PropertiesUtil("medicine.properties");
-        String medicineStr = propertiesUtil.getProperty("chinesemedicine");
+        List<String> chineseMedicine = Content.CHINESEMEDICINE;
+        /*Lists.newArrayList();
+        Properties properties = new Properties();
+        InputStream in = Thread.currentThread().getContextClassLoader()
+                .getResourceAsStream("medicine.properties");
+        try {
+            properties.load(new InputStreamReader(in, "UTF-8"));
+        } catch (Exception e) {
+
+        }
+        String medicineStr = properties.getProperty("chinesemedicine");
         if (StringUtil.isNotBlank(medicineStr)) {
             chineseMedicine = Arrays.stream(medicineStr.split(",")).collect(Collectors.toList());
         }
+        */
+
         Boolean isRecord = false;
         List<DoctorAdviceDoc> recordList = Lists.newLinkedList();
         for (DoctorAdviceDoc item : doctorAdviceDocs) {
@@ -95,32 +108,23 @@ public class THR03236 extends QCCatalogue {
             return;
         }
 
-        String[] dateFormats = new String[]{"yyyy年MM月dd日", "yyyy-MM-dd", "yyyy-MM-dd"};
-
-        List<Date> dateList = date.stream().map(i -> StringUtil.parseDateTime(i, dateFormats))
+        List<Date> dateList = date.stream().map(i -> StringUtil.parseDateTime(i))
                 .filter(Objects::nonNull)
                 .sorted(Comparator.comparing(i -> i))
                 .collect(Collectors.toList());
 
-        Calendar c1 = Calendar.getInstance();
-        c1.setTime(dateList.get(0));
-        c1.add(Calendar.DAY_OF_MONTH, -1);
-        Calendar c2 = Calendar.getInstance();
-        c1.setTime(dateList.get(dateList.size() - 1));
-        c1.add(Calendar.DAY_OF_MONTH, 2);
-
-        Date startDate = c1.getTime();
-        Date endDate = c2.getTime();
+        Date startDate = DateUtil.getFirstTimeOfDay(DateUtil.addDate(dateList.get(0), -1));
+        Date endDate = DateUtil.getFirstTimeOfDay(DateUtil.addDate(dateList.get(dateList.size() - 1), 2));
 
         String regex = "中医辨病辨证依据|中医辩证";
 
         //首次诊疗计划
         if (null != firstCourseRecordDoc) {
             String treatPlan = firstCourseRecordDoc.getStructureMap().get("诊疗计划");
-            Date treatPlanDate = StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("病历日期"), dateFormats);
+            Date treatPlanDate = DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("病历日期")));
             if (StringUtil.isNotBlank(treatPlan)
-                    && treatPlanDate.after(startDate)
-                    && treatPlanDate.before(endDate)
+                    && (!treatPlanDate.after(startDate)
+                    || !treatPlanDate.before(endDate))
                     && RegexUtil.getRegexRes(treatPlan, regex, 2)) {
                 status.set("0");
                 return;
@@ -132,8 +136,8 @@ public class THR03236 extends QCCatalogue {
             threeLevelWardDocs = threeLevelWardDocs.stream()
                     .filter(Objects::nonNull)
                     .filter(i -> i.getStructureMap().containsKey("查房日期") && i.getStructureMap().containsKey("病情记录"))
-                    .filter(i -> StringUtil.parseDateTime(i.getStructureMap().get("查房日期"), dateFormats).after(startDate)
-                            && StringUtil.parseDateTime(i.getStructureMap().get("查房日期"), dateFormats).before(endDate))
+                    .filter(i -> !DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("查房日期"))).after(startDate)
+                            || !DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(i.getStructureMap().get("查房日期"))).before(endDate))
                     .collect(Collectors.toList());
             if (ListUtil.isNotEmpty(threeLevelWardDocs)) {
                 for (ThreeLevelWardDoc item : threeLevelWardDocs) {
@@ -148,10 +152,10 @@ public class THR03236 extends QCCatalogue {
         //出院小结
         if (null != leaveHospitalDoc) {
             String leaveHosText = leaveHospitalDoc.getStructureMap().get("出院医嘱");
-            Date leaveHospitalDate = StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("出院日期"), dateFormats);
+            Date leaveHospitalDate = DateUtil.getFirstTimeOfDay(StringUtil.parseDateTime(firstCourseRecordDoc.getStructureMap().get("出院日期")));
             if (StringUtil.isNotBlank(leaveHosText)
-                    && leaveHospitalDate.after(startDate)
-                    && leaveHospitalDate.before(endDate)
+                    && (!leaveHospitalDate.after(startDate)
+                    || !leaveHospitalDate.before(endDate))
                     && RegexUtil.getRegexRes(leaveHosText, regex, 2)) {
                 status.set("0");
                 return;

文件差异内容过多而无法显示
+ 1 - 1
kernel/src/main/resources/medicine.properties