浏览代码

台州转科记录规则添加

hujing 5 年之前
父节点
当前提交
39f6969b8d

+ 52 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/dutyshiftsystem/DUT0597.java

@@ -0,0 +1,52 @@
+package com.lantone.qc.kernel.catalogue.dutyshiftsystem;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferOutDoc;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : DUT0597
+ * @Description : 转出记录未在转出前完成
+ * @Author : 胡敬
+ * @Date: 2020-03-30 15:06
+ */
+@Component
+public class DUT0597 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<TransferRecordDoc> transferRecordDocs = inputInfo.getTransferRecordDocs();
+        if (ListUtil.isEmpty(transferRecordDocs)) {
+            return;
+        }
+        String rollOutRecordDateStr = "", recordDateStr = "";
+        for (TransferRecordDoc transferRecordDoc : transferRecordDocs) {
+            TransferOutDoc transferOutDoc = transferRecordDoc.getTransferOutDoc();
+            if (transferOutDoc == null) {
+                continue;
+            }
+            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;
+            }
+        }
+
+    }
+}

+ 54 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/dutyshiftsystem/DUT0598.java

@@ -0,0 +1,54 @@
+package com.lantone.qc.kernel.catalogue.dutyshiftsystem;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.pub.model.InputInfo;
+import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferOutDoc;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : DUT0598
+ * @Description : 接科记录未在24h内完成
+ * @Author : 胡敬
+ * @Date: 2020-03-30 15:06
+ */
+@Component
+public class DUT0598 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<TransferRecordDoc> transferRecordDocs = inputInfo.getTransferRecordDocs();
+        if (ListUtil.isEmpty(transferRecordDocs)) {
+            return;
+        }
+        String rollInRecordDateStr = "", recordDateStr = "";
+        for (TransferRecordDoc transferRecordDoc : transferRecordDocs) {
+            TransferOutDoc transferOutDoc = transferRecordDoc.getTransferOutDoc();
+            if (transferOutDoc == null) {
+                continue;
+            }
+            Map<String, String> transferOutStructureMap = transferOutDoc.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;
+                }
+            }
+        }
+    }
+}

+ 82 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/dutyshiftsystem/DUT0599.java

@@ -0,0 +1,82 @@
+package com.lantone.qc.kernel.catalogue.dutyshiftsystem;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+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.transferrecord.TransferOutDoc;
+import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
+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 : DUT0599
+ * @Description : 转科后病程录没有连续记录3天
+ * @Author : 胡敬
+ * @Date: 2020-03-30 15:06
+ */
+@Component
+public class DUT0599 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<TransferRecordDoc> transferRecordDocs = inputInfo.getTransferRecordDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (ListUtil.isEmpty(transferRecordDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
+            return;
+        }
+        //所有查房记录的日期天
+        List<Integer> wardRecordDayList = getWardRecordDay(threeLevelWardDocs);
+        String rollInRecordDateStr = "";
+        //转入日期后应该有的查房记录的日期天
+        List<Integer> rollInDay = null;
+        for (TransferRecordDoc transferRecordDoc : transferRecordDocs) {
+            TransferOutDoc transferOutDoc = transferRecordDoc.getTransferOutDoc();
+            if (transferOutDoc == null) {
+                continue;
+            }
+            Map<String, String> transferOutStructureMap = transferOutDoc.getStructureMap();
+            rollInRecordDateStr = transferOutStructureMap.get("患者于");
+            if (CatalogueUtil.isEmpty(rollInRecordDateStr)) {
+                continue;
+            }
+            Date rollInRecordDate = StringUtil.parseDateTime(rollInRecordDateStr);
+            rollInDay = new ArrayList<>();
+            for (int i = 1; i <= 3; i++) {
+                int wardRecordDay = DateUtil.getDay(DateUtil.addDate(rollInRecordDate, i));
+                rollInDay.add(wardRecordDay);
+            }
+            if (!wardRecordDayList.containsAll(rollInDay)) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+
+    /**
+     * 所有查房记录的日期天
+     *
+     * @param threeLevelWardDocs
+     */
+    private List<Integer> getWardRecordDay(List<ThreeLevelWardDoc> threeLevelWardDocs) {
+        List<Integer> dateRecordDay = new ArrayList<>();
+        String recordTime = "";
+        for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+            Map<String, String> rescueStructureMap = threeLevelWardDoc.getStructureMap();
+            recordTime = rescueStructureMap.get("查房日期");
+            Date recordDate = StringUtil.parseDateTime(recordTime);
+            if (recordDate == null) {
+                continue;
+            }
+            dateRecordDay.add(DateUtil.getDay(recordDate));
+        }
+        return dateRecordDay;
+    }
+}