فهرست منبع

三级查房规则修改

hujing 5 سال پیش
والد
کامیت
ce3a88de26

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

@@ -5,13 +5,20 @@ 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.DeathRecordDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.doc.SeriouslyIllNoticeDoc;
 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.*;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
 
 /**
  * @ClassName : THR0434
@@ -23,9 +30,41 @@ import java.util.*;
 public class THR0434 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        //没有死亡记录并且没有离院记录,直接返回
+        if (inputInfo.getDeathRecordDoc() == null && inputInfo.getLeaveHospitalDoc() == null) {
+            return;
+        }
+        //没有病重通知书或者查房记录,直接返回
         if (ListUtil.isEmpty(inputInfo.getSeriouslyIllNoticeDocs()) || ListUtil.isEmpty(inputInfo.getThreeLevelWardDocs())) {
             return;
         }
+        //死亡记录不为空
+        if (inputInfo.getDeathRecordDoc() != null) {
+            DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
+            Map<String, String> deathRecordStructureMap = deathRecordDoc.getStructureMap();
+            String deathTime = deathRecordStructureMap.get("死亡时间");
+            if (StringUtil.isNotBlank(deathTime)) {
+                Date deathDate = StringUtil.parseDateTime(deathTime);
+                if (deathDate != null) {
+                    dealWithRescueRecord(inputInfo, deathDate);
+                }
+            }
+        }
+        //离院记录不为空
+        if (inputInfo.getLeaveHospitalDoc() != null) {
+            LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+            Map<String, String> leaveHospitalStructureMap = leaveHospitalDoc.getStructureMap();
+            String leaveHospitalTime = leaveHospitalStructureMap.get("出院时间");
+            if (StringUtil.isNotBlank(leaveHospitalTime)) {
+                Date leaveHospitalDate = StringUtil.parseDateTime(leaveHospitalTime);
+                if (leaveHospitalDate != null) {
+                    dealWithRescueRecord(inputInfo, leaveHospitalDate);
+                }
+            }
+        }
+    }
+
+    private void dealWithRescueRecord(InputInfo inputInfo, Date timeOfComparison) {
         List<SeriouslyIllNoticeDoc> seriouslyIllNoticeDocs = inputInfo.getSeriouslyIllNoticeDocs(); //病危通知书
         Map<Date, Map<String, String>> dateRecord = new TreeMap<>(new Comparator<Date>() {
             @Override

+ 34 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0435.java

@@ -5,7 +5,9 @@ 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.DeathRecordDoc;
 import com.lantone.qc.pub.model.doc.DifficultCaseDiscussDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
@@ -28,9 +30,41 @@ import java.util.TreeMap;
 public class THR0435 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        //没有死亡记录并且没有离院记录,直接返回
+        if (inputInfo.getDeathRecordDoc() == null && inputInfo.getLeaveHospitalDoc() == null) {
+            return;
+        }
+        //没有疑难病例讨论记录或者查房记录,直接返回
         if (ListUtil.isEmpty(inputInfo.getDifficultCaseDiscussDocs()) || ListUtil.isEmpty(inputInfo.getThreeLevelWardDocs())) {
             return;
         }
+        //死亡记录不为空
+        if (inputInfo.getDeathRecordDoc() != null) {
+            DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
+            Map<String, String> deathRecordStructureMap = deathRecordDoc.getStructureMap();
+            String deathTime = deathRecordStructureMap.get("死亡时间");
+            if (StringUtil.isNotBlank(deathTime)) {
+                Date deathDate = StringUtil.parseDateTime(deathTime);
+                if (deathDate != null) {
+                    dealWithRescueRecord(inputInfo, deathDate);
+                }
+            }
+        }
+        //离院记录不为空
+        if (inputInfo.getLeaveHospitalDoc() != null) {
+            LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+            Map<String, String> leaveHospitalStructureMap = leaveHospitalDoc.getStructureMap();
+            String leaveHospitalTime = leaveHospitalStructureMap.get("出院时间");
+            if (StringUtil.isNotBlank(leaveHospitalTime)) {
+                Date leaveHospitalDate = StringUtil.parseDateTime(leaveHospitalTime);
+                if (leaveHospitalDate != null) {
+                    dealWithRescueRecord(inputInfo, leaveHospitalDate);
+                }
+            }
+        }
+    }
+
+    private void dealWithRescueRecord(InputInfo inputInfo, Date timeOfComparison) {
         List<DifficultCaseDiscussDoc> difficultCaseDiscussDocs = inputInfo.getDifficultCaseDiscussDocs(); //疑难病例讨论记录
         Map<Date, Map<String, String>> dateRecord = new TreeMap<>(new Comparator<Date>() {
             @Override

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

@@ -5,6 +5,8 @@ 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.DeathRecordDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.doc.RescueDoc;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.util.ListUtil;
@@ -28,9 +30,41 @@ import java.util.TreeMap;
 public class THR0436 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
+        //没有死亡记录并且没有离院记录,直接返回
+        if (inputInfo.getDeathRecordDoc() == null && inputInfo.getLeaveHospitalDoc() == null) {
+            return;
+        }
+        //没有抢救记录或者查房记录,直接返回
         if (ListUtil.isEmpty(inputInfo.getRescueDocs()) || ListUtil.isEmpty(inputInfo.getThreeLevelWardDocs())) {
             return;
         }
+        //死亡记录不为空
+        if (inputInfo.getDeathRecordDoc() != null) {
+            DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
+            Map<String, String> deathRecordStructureMap = deathRecordDoc.getStructureMap();
+            String deathTime = deathRecordStructureMap.get("死亡时间");
+            if (StringUtil.isNotBlank(deathTime)) {
+                Date deathDate = StringUtil.parseDateTime(deathTime);
+                if (deathDate != null) {
+                    dealWithRescueRecord(inputInfo, deathDate);
+                }
+            }
+        }
+        //离院记录不为空
+        if (inputInfo.getLeaveHospitalDoc() != null) {
+            LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+            Map<String, String> leaveHospitalStructureMap = leaveHospitalDoc.getStructureMap();
+            String leaveHospitalTime = leaveHospitalStructureMap.get("出院时间");
+            if (StringUtil.isNotBlank(leaveHospitalTime)) {
+                Date leaveHospitalDate = StringUtil.parseDateTime(leaveHospitalTime);
+                if (leaveHospitalDate != null) {
+                    dealWithRescueRecord(inputInfo, leaveHospitalDate);
+                }
+            }
+        }
+    }
+
+    private void dealWithRescueRecord(InputInfo inputInfo, Date timeOfComparison) {
         List<RescueDoc> rescueDocs = inputInfo.getRescueDocs(); //抢救记录
         Map<Date, Map<String, String>> dateRecord = new TreeMap<>(new Comparator<Date>() {
             @Override
@@ -44,7 +78,7 @@ public class THR0436 extends QCCatalogue {
             Map<String, String> rescueStructureMap = rescueDoc.getStructureMap();
             recordTime = rescueStructureMap.get("抢救时间");
             Date recordDate = StringUtil.parseDateTime(recordTime);
-            if (recordDate == null) {
+            if (recordDate == null || CatalogueUtil.equalsDate(recordDate, timeOfComparison, "yyyy-MM-dd")) {
                 continue;
             }
             dateRecord.put(recordDate, rescueStructureMap);