소스 검색

台州查房记录规则添加

hujing 5 년 전
부모
커밋
213ec293cc

+ 84 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0587.java

@@ -0,0 +1,84 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+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.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+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 : THR0587
+ * @Description : 术后病程录没有连续记录3天
+ * @Author : 胡敬
+ * @Date: 2020-03-30 16:17
+ */
+@Component
+public class THR0587 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (ListUtil.isEmpty(operationDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
+            return;
+        }
+        //所有查房记录的日期天
+        List<Integer> wardRecordDayList = getWardRecordDay(threeLevelWardDocs);
+        String OperationEndDateStr = "";
+        //转入日期后应该有的查房记录的日期天
+        List<Integer> rollInDay = null;
+        for (OperationDoc operationDoc : operationDocs) {
+            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+            if (operationRecordDoc == null) {
+                continue;
+            }
+            Map<String, String> operationRecordStructureMap = operationRecordDoc.getStructureMap();
+            OperationEndDateStr = operationRecordStructureMap.get("手术结束时间");
+            if (CatalogueUtil.isEmpty(OperationEndDateStr)) {
+                continue;
+            }
+            Date OperationEndDate = StringUtil.parseDateTime(OperationEndDateStr);
+            rollInDay = new ArrayList<>();
+            for (int i = 1; i <= 3; i++) {
+                int wardRecordDay = DateUtil.getDay(DateUtil.addDate(OperationEndDate, 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;
+    }
+}

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

@@ -24,7 +24,7 @@ import java.util.Map;
 public class THR0595 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
-        if (inputInfo.getSeriouslyIllNoticeDocs().size() == 0 || inputInfo.getThreeLevelWardDocs().size() == 0) {
+        if (inputInfo.getCriticallyIllNoticeDocs().size() == 0 || inputInfo.getThreeLevelWardDocs().size() == 0) {
             return;
         }
         //所有查房记录的日期天

+ 42 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0601.java

@@ -0,0 +1,42 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+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.ThreeLevelWardDoc;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : THR0601
+ * @Description : 整份病历无主治医师查房记录
+ * @Author : 胡敬
+ * @Date: 2020-03-25 10:21
+ */
+@Component
+public class THR0601 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getThreeLevelWardDocs().size() == 0) {
+            return;
+        }
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();//查房记录
+        String title;
+        boolean findIndications = false;
+        for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+            Map<String, String> rescueStructureMap = threeLevelWardDoc.getStructureMap();
+            title = CatalogueUtil.subTitle(rescueStructureMap.get("查房标题"));
+            if (!CatalogueUtil.isEmpty(title) && title.contains(Content.indications)) {
+                findIndications = true;
+                break;
+            }
+        }
+        if (!findIndications) {
+            status.set("-1");
+        }
+    }
+}

+ 110 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0602.java

@@ -0,0 +1,110 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+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.ThreeLevelWardDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
+import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
+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.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : THR0602
+ * @Description : 主治医师在术后48小时内无查房记录
+ * @Author : 胡敬
+ * @Date: 2020-03-30 14:03
+ */
+@Component
+public class THR0602 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (ListUtil.isEmpty(operationDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
+            return;
+        }
+        for (OperationDoc operationDoc : operationDocs) {
+            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
+            if (operationRecordDoc == null) {
+                continue;
+            }
+            Map<String, String> operationRecordStructureMap = operationRecordDoc.getStructureMap();
+            String operationEndDateStr = operationRecordStructureMap.get("手术结束时间");
+            if (CatalogueUtil.isEmpty(operationEndDateStr)) {
+                continue;
+            }
+            Map<String, String> doctorRecord = extractWardRecord(
+                    threeLevelWardDocs,
+                    operationEndDateStr,
+                    48 * 60);
+            if (!doctorRecord.containsKey(Content.indications)) {
+                status.set("-1");
+                return;
+            }
+        }
+
+
+    }
+
+    /**
+     * 抽取住院duration分钟内查房记录并取第一条主治医师查房记录以及第一条主任/副主任医师查房记录
+     *
+     * @param threeLevelWardDocs
+     * @param admisTime
+     * @param duration
+     * @return
+     */
+    private static Map<String, String> extractWardRecord(List<ThreeLevelWardDoc> threeLevelWardDocs, String admisTime, int duration) {
+        Map<Date, String> dateRecord = new HashMap<>();
+        List<String> sortRecord = new ArrayList<>();
+        Map<String, String> doctorRecord = new HashMap<>();
+        String recordTime = "";
+        Date admisDate = StringUtil.parseDateTime(admisTime);
+        if (admisDate == null) {
+            return doctorRecord;
+        }
+        for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+            Map<String, String> threeLevelWardStructureMap = threeLevelWardDoc.getStructureMap();
+            recordTime = threeLevelWardStructureMap.get("查房日期");
+            Date recordDate = StringUtil.parseDateTime(recordTime);
+            if (recordDate == null) {
+                continue;
+            }
+            if (admisDate.before(recordDate) && !CatalogueUtil.compareTime(admisDate, recordDate, Long.valueOf(duration))) {
+                String wardTitle = threeLevelWardStructureMap.get("查房标题");
+                wardTitle = StringUtil.isBlank(wardTitle) ? "" : wardTitle;
+                dateRecord.put(recordDate, wardTitle);
+            }
+        }
+        dateRecord.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEachOrdered(
+                x -> sortRecord.add(x.getValue())
+        );
+        //按时间排好序查房记录的第一条主治医师查房记录存进doctorRecord
+        for (String record : sortRecord) {
+            if (!CatalogueUtil.subTitle(record).contains(Content.indications)) {
+                continue;
+            }
+            doctorRecord.put(Content.indications, record);
+            break;
+        }
+        //按时间排好序查房记录的第一条主任医师/副主任医师查房记录存进doctorRecord
+        for (String record : sortRecord) {
+            if (!CatalogueUtil.subTitle(record).contains(Content.director)) {
+                continue;
+            }
+            doctorRecord.put(Content.director, record);
+            break;
+        }
+        return doctorRecord;
+    }
+}

+ 47 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0603.java

@@ -0,0 +1,47 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+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.CriticallyIllNoticeDoc;
+import com.lantone.qc.pub.model.doc.DifficultCaseDiscussDoc;
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+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 : THR0603
+ * @Description : 对危重疑难病人的上级医师查房记录未精确到时分
+ * @Author : 胡敬
+ * @Date: 2020-03-30 14:13
+ */
+@Component
+public class THR0603 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<CriticallyIllNoticeDoc> criticallyIllNoticeDocs = inputInfo.getCriticallyIllNoticeDocs();
+        List<DifficultCaseDiscussDoc> difficultCaseDiscussDocs = inputInfo.getDifficultCaseDiscussDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (ListUtil.isEmpty(criticallyIllNoticeDocs) && ListUtil.isEmpty(difficultCaseDiscussDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
+            return;
+        }
+        String wardRecordDateStr;
+        for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+            Map<String, String> rescueStructureMap = threeLevelWardDoc.getStructureMap();
+            wardRecordDateStr = rescueStructureMap.get("查房日期");
+            Date wardRecordDate = StringUtil.parseDateTime(CatalogueUtil.removeSpecialChar(wardRecordDateStr)
+                    , CatalogueUtil.processDateFormat(Content.dateFormats));
+            if (null == wardRecordDate) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}

+ 45 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0606.java

@@ -0,0 +1,45 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
+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.RescueDoc;
+import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
+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 : THR0606
+ * @Description : 对抢救病人的上级医师查房记录未精确到时分
+ * @Author : 胡敬
+ * @Date: 2020-03-30 14:13
+ */
+@Component
+public class THR0606 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        List<RescueDoc> rescueDocs = inputInfo.getRescueDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
+        if (ListUtil.isEmpty(rescueDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
+            return;
+        }
+        String wardRecordDateStr;
+        for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
+            Map<String, String> rescueStructureMap = threeLevelWardDoc.getStructureMap();
+            wardRecordDateStr = rescueStructureMap.get("查房日期");
+            Date wardRecordDate = StringUtil.parseDateTime(CatalogueUtil.removeSpecialChar(wardRecordDateStr)
+                    , CatalogueUtil.processDateFormat(Content.dateFormats));
+            if (null == wardRecordDate) {
+                status.set("-1");
+                return;
+            }
+        }
+    }
+}