Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/beilun/dev' into beilun/dev

rengb 4 anni fa
parent
commit
aa5e674c2a

+ 29 - 25
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/operationdiscussion/OPE02930.java

@@ -8,6 +8,7 @@ import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
 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.apache.commons.lang3.time.DateUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
@@ -42,46 +43,49 @@ public class OPE02930 extends QCCatalogue {
             if (StringUtil.isEmpty(operationStartDateStr) || StringUtil.isEmpty(operationEndDateStr)) {
                 continue;
             }
-            Date operationStartDate = StringUtil.parseDateTime(operationStartDateStr);
-            Date operationEndDate = StringUtil.parseDateTime(operationEndDateStr);
-            if (operationStartDate == null || operationEndDate == null) {
+            if (!isDate(operationStartDateStr) || !isDate(operationEndDateStr)) {
                 continue;
             }
+            Date operationStartDate = StringUtil.parseDateTime(operationStartDateStr);
+            Date operationEndDate = StringUtil.parseDateTime(operationEndDateStr);
             for (OperationDoc o : operationDocs) {
                 OperationDiscussionDoc operationDiscussionDoc = o.getOperationDiscussionDoc();
                 if (operationDiscussionDoc == null) {
                     continue;
                 }
                 Map<String, String> structureMap = operationDiscussionDoc.getStructureMap();
-                String discussionStartDateStr = structureMap.get("手术开始时间");
-                String discussionEndDateStr = structureMap.get("手术结束时间");
-                if (StringUtil.isBlank(discussionStartDateStr) || StringUtil.isBlank(discussionEndDateStr)) {
-                    continue;
-                }
-                Date discussionStartDate = StringUtil.parseDateTime(discussionStartDateStr);
-                Date discussionEndDate = StringUtil.parseDateTime(discussionEndDateStr);
-                if (discussionStartDate == null || discussionEndDate == null) {
-                    continue;
+                String discussionRecordDateStr = structureMap.get("病历日期");
+                if (StringUtil.isBlank(discussionRecordDateStr)) {
+                    status.set("0");
+                    return;
                 }
-                if (operationStartDate.equals(discussionStartDate) && operationEndDate.equals(discussionEndDate)) {
-                    String discussionRecordDateStr = structureMap.get("记录时间");
-                    if (StringUtil.isBlank(discussionRecordDateStr)) {
-                        status.set("0");
-                        return;
-                    }
-                    Date discussionRecordDate = StringUtil.parseDateTime(discussionRecordDateStr);
-                    if (discussionRecordDate == null) {
-                        status.set("0");
-                        return;
-                    }
 
-                    if (CatalogueUtil.compareTime(discussionEndDate, discussionRecordDate, 15 * 60L)) {
+                if (!isDate(discussionRecordDateStr)) {
+                    status.set("0");
+                    return;
+                }
+                Date discussionRecordDate = StringUtil.parseDateTime(discussionRecordDateStr);
+                if (operationEndDate.before(discussionRecordDate) || DateUtils.isSameDay(operationEndDate, discussionRecordDate)) {
+                    if (CatalogueUtil.compareTime(operationEndDate, discussionRecordDate, 2 * 60L)) {
                         status.set("-1");
                         return;
                     }
                 }
             }
         }
-        //        }
+    }
+
+    /**
+     * 判断是否为日期
+     *
+     * @param dateStr
+     */
+    private boolean isDate(String dateStr) {
+        try {
+            StringUtil.parseDateTime(dateStr);
+            return true;
+        } catch (IllegalArgumentException e) {
+            return false;
+        }
     }
 }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/threelevelward/THR0588.java

@@ -112,7 +112,7 @@ public class THR0588 extends QCCatalogue {
         //获取连续3天无查房记录的时间
         for (int i = 0; i < dateThreeLevelDay.size(); i++) {
             if (i + 1 < dateThreeLevelDay.size()) {
-                if (CatalogueUtil.compareTime(dateThreeLevelDay.get(i), dateThreeLevelDay.get(i + 1), 72 * 60L) &&
+                if (CatalogueUtil.compareTime(DateUtil.dateZeroClear(dateThreeLevelDay.get(i)), DateUtil.dateZeroClear(dateThreeLevelDay.get(i + 1)), 72 * 60L) &&
                         dateThreeLevelDay.get(i + 1).before(leaveDate)) {
                     infoAppend(sb, dateThreeLevelDay.get(i), dateThreeLevelDay.get(i + 1));
                 }

+ 7 - 7
trans/src/main/java/com/lantone/qc/trans/yiwu/YiWuBeHospitalizedDocTrans.java

@@ -186,7 +186,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
         //        structureMap.remove("既往史");
 
         PersonalLabel personalLabel = new PersonalLabel();
-        personalLabel.setCrfLabel(false);
+//        personalLabel.setCrfLabel(false);
         personalLabel.setText(structureMap.get("个人史"));
         beHospitalizedDoc.setPersonalLabel(personalLabel);
         if (StringUtil.isBlank(structureMap.get("个人史"))) {
@@ -195,7 +195,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
         //        structureMap.remove("个人史");
 
         MaritalLabel maritalLabel = new MaritalLabel();
-        maritalLabel.setCrfLabel(false);
+//        maritalLabel.setCrfLabel(false);
         maritalLabel.setText("婚育史: " + structureMap.get("婚育史"));
         beHospitalizedDoc.setMaritalLabel(maritalLabel);
         if (StringUtil.isBlank(structureMap.get("婚育史"))) {
@@ -204,7 +204,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
         //        structureMap.remove("婚育史");
 
         MenstrualLabel menstrualLabel = new MenstrualLabel();
-        menstrualLabel.setCrfLabel(false);
+//        menstrualLabel.setCrfLabel(false);
         menstrualLabel.setText("月经史:" + structureMap.get("月经史"));
         beHospitalizedDoc.setMenstrualLabel(menstrualLabel);
         if (StringUtil.isBlank(structureMap.get("月经史"))) {
@@ -213,7 +213,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
         //        structureMap.remove("月经史");
 
         FamilyLabel familyLabel = new FamilyLabel();
-        familyLabel.setCrfLabel(false);
+//        familyLabel.setCrfLabel(false);
         familyLabel.setText(structureMap.get("家族史"));
         beHospitalizedDoc.setFamilyLabel(familyLabel);
         if (StringUtil.isBlank(structureMap.get("家族史"))) {
@@ -222,7 +222,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
         //        structureMap.remove("家族史");
 
         VitalLabel vitalLabel = new VitalLabel();
-        vitalLabel.setCrfLabel(false);
+//        vitalLabel.setCrfLabel(false);
         vitalLabel.setText(structureMap.get("体格检查"));
         beHospitalizedDoc.setVitalLabel(vitalLabel);
         if (StringUtil.isBlank(structureMap.get("体格检查"))) {
@@ -231,7 +231,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
         //        structureMap.remove("体格检查");
 
         VitalLabelSpecial vitalLabelSpecial = new VitalLabelSpecial();
-        vitalLabelSpecial.setCrfLabel(false);
+//        vitalLabelSpecial.setCrfLabel(false);
         vitalLabelSpecial.setText(structureMap.get("专科体格检查"));
         beHospitalizedDoc.setVitalLabelSpecial(vitalLabelSpecial);
         if (StringUtil.isBlank(structureMap.get("专科体格检查"))) {
@@ -241,7 +241,7 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
 
         // 走模型
         PacsLabel pacsLabel = new PacsLabel();
-        pacsLabel.setCrfLabel(false);
+//        pacsLabel.setCrfLabel(false);
         pacsLabel.setText(structureMap.get("辅助检查"));
         beHospitalizedDoc.setPacsLabel(pacsLabel);
         if (StringUtil.isBlank(structureMap.get("辅助检查"))) {