Explorar o código

北仑:转入转出的转科日期从住院登记表中获取

wangsy %!s(int64=4) %!d(string=hai) anos
pai
achega
7be067055d

+ 17 - 12
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/dutyshiftsystem/DUT0597.java

@@ -29,18 +29,23 @@ public class DUT0597 extends QCCatalogue {
         }
         String rollOutRecordDateStr = "", recordDateStr = "";
         List<TransferOutDoc> transferOutDocs = transferRecordDoc.getTransferOutDocs();
-        for (TransferOutDoc transferOutDoc : transferOutDocs) {
-            Map<String, String> transferOutStructureMap = transferOutDoc.getStructureMap();
-            rollOutRecordDateStr = transferOutStructureMap.get("转科日期");
-            recordDateStr = transferOutStructureMap.get("记录日期");
-            if (CatalogueUtil.isEmpty(rollOutRecordDateStr) || CatalogueUtil.isEmpty(recordDateStr)) {
-                continue;
-            }
-            Date rollOutRecordDate = StringUtil.parseDateTime(rollOutRecordDateStr);
-            Date recordDate = StringUtil.parseDateTime(recordDateStr);
-            if (rollOutRecordDate != null && recordDate != null && rollOutRecordDate.before(recordDate)) {
-                status.set("-1");
-                return;
+        if (inputInfo.getMedicalRecordInfoDoc() != null) {
+            Map<String, String> medicalRecordInfoStructureMap = inputInfo.getMedicalRecordInfoDoc().getStructureMap();
+            //转入时间
+            rollOutRecordDateStr = medicalRecordInfoStructureMap.get("transOutTime");
+            for (TransferOutDoc transferOutDoc : transferOutDocs) {
+                Map<String, String> transferOutStructureMap = transferOutDoc.getStructureMap();
+//                rollOutRecordDateStr = transferOutStructureMap.get("转科日期");
+                recordDateStr = transferOutStructureMap.get("病历日期");
+                if (CatalogueUtil.isEmpty(rollOutRecordDateStr) || CatalogueUtil.isEmpty(recordDateStr)) {
+                    continue;
+                }
+                Date rollOutRecordDate = StringUtil.parseDateTime(rollOutRecordDateStr);
+                Date recordDate = StringUtil.parseDateTime(recordDateStr);
+                if (rollOutRecordDate != null && recordDate != null && rollOutRecordDate.before(recordDate)) {
+                    status.set("-1");
+                    return;
+                }
             }
         }
 

+ 22 - 14
kernel/src/main/java/com/lantone/qc/kernel/catalogue/beilun/dutyshiftsystem/DUT0598.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.transferrecord.TransferIntoDoc;
 import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
 import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.time.DateUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
@@ -29,20 +30,27 @@ public class DUT0598 extends QCCatalogue {
         }
         List<TransferIntoDoc> transferIntoDocs = transferRecordDoc.getTransferIntoDocs();
         String rollInRecordDateStr = "", recordDateStr = "";
-        for (TransferIntoDoc transferIntoDoc : transferIntoDocs) {
-            Map<String, String> transferOutStructureMap = transferIntoDoc.getStructureMap();
-            rollInRecordDateStr = transferOutStructureMap.get("转科日期");
-            recordDateStr = transferOutStructureMap.get("记录日期");
-            if (CatalogueUtil.isEmpty(rollInRecordDateStr) || CatalogueUtil.isEmpty(recordDateStr)) {
-                continue;
-            }
-            Date rollOutRecordDate = StringUtil.parseDateTime(rollInRecordDateStr);
-            Date recordDate = StringUtil.parseDateTime(recordDateStr);
-            if (rollOutRecordDate != null && recordDate != null && rollOutRecordDate.before(recordDate)) {
-                boolean compareTime = CatalogueUtil.compareTime(rollOutRecordDate, recordDate, (long) 24 * 60);
-                if (compareTime) {
-                    status.set("-1");
-                    return;
+        if (inputInfo.getMedicalRecordInfoDoc() != null) {
+            Map<String, String> medicalRecordInfoStructureMap = inputInfo.getMedicalRecordInfoDoc().getStructureMap();
+            //转入时间
+            rollInRecordDateStr = medicalRecordInfoStructureMap.get("transInTime");
+
+            for (TransferIntoDoc transferIntoDoc : transferIntoDocs) {
+                Map<String, String> transferOutStructureMap = transferIntoDoc.getStructureMap();
+//                rollInRecordDateStr = transferOutStructureMap.get("转科日期");
+                recordDateStr = transferOutStructureMap.get("病历日期");
+                if (CatalogueUtil.isEmpty(rollInRecordDateStr) || CatalogueUtil.isEmpty(recordDateStr)) {
+                    continue;
+                }
+                Date rollOutRecordDate = StringUtil.parseDateTime(rollInRecordDateStr);
+                Date recordDate = StringUtil.parseDateTime(recordDateStr);
+                if (rollOutRecordDate != null && recordDate != null && rollOutRecordDate.before(recordDate)) {
+                    boolean compareTime = CatalogueUtil.compareTime(rollOutRecordDate, recordDate, (long) 24 * 60);
+                    DateUtils.isSameDay(rollOutRecordDate, recordDate);
+                    if (compareTime) {
+                        status.set("-1");
+                        return;
+                    }
                 }
             }
         }