Browse Source

Merge remote-tracking branch 'origin/his/yiwufubao' into his/yiwufubao

wangsy 3 years ago
parent
commit
a99e8a11f2

+ 20 - 14
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03330.java

@@ -8,11 +8,13 @@ import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
 import com.lantone.qc.pub.model.entity.Diag;
 import com.lantone.qc.pub.model.label.DiagLabel;
 import com.lantone.qc.pub.model.label.PastLabel;
+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;
 
 
@@ -42,22 +44,31 @@ public class BEH03330 extends QCCatalogue {
         String eDOC = beHospitalizedDoc.getStructureMap().get("预产期");
         //末次月经
         String lastMP = beHospitalizedDoc.getStructureMap().get("末次月经");
-        //末次月经月份
-        String lastMPMonth = beHospitalizedDoc.getStructureMap().get("末次月经月份");
-        //末次月经日
-        String lastMPDay = beHospitalizedDoc.getStructureMap().get("末次月经日");
-        if (StringUtil.isBlank(eDOC) || StringUtil.isBlank(lastMP) || StringUtil.isBlank(lastMPMonth) || StringUtil.isBlank(lastMPDay)) {
+        if (StringUtil.isBlank(eDOC) || StringUtil.isBlank(lastMP)) {
+            return;
+        }
+        Date eDOCDate = StringUtil.parseDateTime(eDOC);
+        Date lastMPDate = StringUtil.parseDateTime(lastMP);
+        if (eDOCDate == null || lastMPDate == null) {
             return;
         }
-
         try {
-            int lastMPMonthNum = strConvertInt(lastMPMonth) + 9 > 12 ? strConvertInt(lastMPMonth) - 3 : strConvertInt(lastMPMonth) + 9;
-            int lastMPDayNum = strConvertInt(lastMPDay) + 7;
+            //预产期月份
+            int eDOCMonth = DateUtil.getMonth(eDOCDate);
+            //预产期日
+            int eDOCDay = DateUtil.getDay(eDOCDate);
+            //末次月经月份
+            int lastMPMonth = DateUtil.getMonth(lastMPDate);
+            //末次月经日
+            int lastMPDay = DateUtil.getDay(lastMPDate);
+
+            int lastMPMonthNum = lastMPMonth + 9 > 12 ? lastMPMonth - 3 : lastMPMonth + 9;
+            int lastMPDayNum = lastMPDay + 7;
             if (lastMPDayNum > 30) {
                 lastMPMonthNum = lastMPMonthNum + 1;
                 lastMPDayNum = lastMPDayNum - 30;
             }
-            if (lastMPMonthNum != lastMPDayNum) {
+            if (eDOCMonth != lastMPMonthNum || eDOCDay != lastMPDayNum) {
                 status.set("-1");
                 return;
             }
@@ -67,9 +78,4 @@ public class BEH03330 extends QCCatalogue {
 
     }
 
-    //String转int
-    private int strConvertInt(String str) {
-        return Integer.parseInt(str);
-    }
-
 }

+ 21 - 15
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC03331.java

@@ -3,11 +3,13 @@ package com.lantone.qc.kernel.catalogue.firstcourserecord;
 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.BeHospitalizedDoc;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
+import com.lantone.qc.pub.util.DateUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
+
 
 /**
  * @ClassName : FIRC03331
@@ -35,22 +37,31 @@ public class FIRC03331 extends QCCatalogue {
         String eDOC = firstCourseRecordDoc.getStructureMap().get("预产期");
         //末次月经
         String lastMP = firstCourseRecordDoc.getStructureMap().get("末次月经");
-        //末次月经月份
-        String lastMPMonth = firstCourseRecordDoc.getStructureMap().get("末次月经月份");
-        //末次月经日
-        String lastMPDay = firstCourseRecordDoc.getStructureMap().get("末次月经日");
-        if (StringUtil.isBlank(eDOC) || StringUtil.isBlank(lastMP) || StringUtil.isBlank(lastMPMonth) || StringUtil.isBlank(lastMPDay)) {
+        if (StringUtil.isBlank(eDOC) || StringUtil.isBlank(lastMP)) {
+            return;
+        }
+        Date eDOCDate = StringUtil.parseDateTime(eDOC);
+        Date lastMPDate = StringUtil.parseDateTime(lastMP);
+        if (eDOCDate == null || lastMPDate == null) {
             return;
         }
-
         try {
-            int lastMPMonthNum = strConvertInt(lastMPMonth) + 9 > 12 ? strConvertInt(lastMPMonth) - 3 : strConvertInt(lastMPMonth) + 9;
-            int lastMPDayNum = strConvertInt(lastMPDay) + 7;
+            //预产期月份
+            int eDOCMonth = DateUtil.getMonth(eDOCDate);
+            //预产期日
+            int eDOCDay = DateUtil.getDay(eDOCDate);
+            //末次月经月份
+            int lastMPMonth = DateUtil.getMonth(lastMPDate);
+            //末次月经日
+            int lastMPDay = DateUtil.getDay(lastMPDate);
+
+            int lastMPMonthNum = lastMPMonth + 9 > 12 ? lastMPMonth - 3 : lastMPMonth + 9;
+            int lastMPDayNum = lastMPDay + 7;
             if (lastMPDayNum > 30) {
                 lastMPMonthNum = lastMPMonthNum + 1;
                 lastMPDayNum = lastMPDayNum - 30;
             }
-            if (lastMPMonthNum != lastMPDayNum) {
+            if (eDOCMonth != lastMPMonthNum || eDOCDay != lastMPDayNum) {
                 status.set("-1");
                 return;
             }
@@ -60,9 +71,4 @@ public class FIRC03331 extends QCCatalogue {
 
     }
 
-    //String转int
-    private int strConvertInt(String str) {
-        return Integer.parseInt(str);
-    }
-
 }

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA03290.java

@@ -45,7 +45,7 @@ public class LEA03290 extends QCCatalogue {
         BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
         //获取病案首页
         FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
-        if (beHospitalizedDoc == null || firstPageRecordDoc == null) {
+        if (beHospitalizedDoc == null && firstPageRecordDoc == null) {
             return;
         }
         //匹配疾病正则
@@ -103,6 +103,7 @@ public class LEA03290 extends QCCatalogue {
             //获取出院小结
             LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
             if (leaveHospitalDoc == null) {
+                status.set("0");
                 return;
             }
             String leaveDiag = leaveHospitalDoc.getStructureMap().get("出院诊断");

+ 11 - 5
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA03323.java

@@ -110,24 +110,30 @@ public class LEA03323 extends QCCatalogue {
             //获取出院小结
             LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
             if (leaveHospitalDoc == null) {
+                status.set("0");
                 return;
             }
             //获取入院诊断
             DiagLabel beHospitalizedLabel = leaveHospitalDoc.getBeHospitalizedLabel();
             if (beHospitalizedLabel == null) {
+                status.set("0");
                 return;
             }
             List<Diag> diags = beHospitalizedLabel.getDiags();
             if (ListUtil.isEmpty(diags)) {
+                status.set("0");
                 return;
             }
             for (Diag diag : diags) {
                 String diagName = diag.getHospitalDiagName();
-                for (String diagCollectName : diagCollectList) {
-                    if (StringUtil.isNotEmpty(diagName) && StringUtil.isNotEmpty(diagCollectName)) {
-                        if (getLikeRate(diagName, diagCollectName)) {
-                            status.set("0");
-                            return;
+                for (String diagCollect : diagCollectList) {
+                    String[] split = diagCollect.split(" ");
+                    for (String diagCollectName : split) {
+                        if (StringUtil.isNotEmpty(diagName) && StringUtil.isNotEmpty(diagCollectName)) {
+                            if (getLikeRate(diagName, diagCollectName)) {
+                                status.set("0");
+                                return;
+                            }
                         }
                     }
                 }

File diff suppressed because it is too large
+ 21 - 19
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR03309.java