|
@@ -0,0 +1,66 @@
|
|
|
|
+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.util.DateUtil;
|
|
|
|
+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 : THR0595
|
|
|
|
+ * @Description : 病重患者每2天应有一次病程记录
|
|
|
|
+ * @Author : 胡敬
|
|
|
|
+ * @Date: 2020-03-28 14:22
|
|
|
|
+ */
|
|
|
|
+@Component
|
|
|
|
+public class THR0595 extends QCCatalogue {
|
|
|
|
+ public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
|
+ status.set("0");
|
|
|
|
+ if (inputInfo.getSeriouslyIllNoticeDocs().size() == 0 || inputInfo.getThreeLevelWardDocs().size() == 0) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ //所有查房记录的日期天
|
|
|
|
+ List<Integer> dateRecordDay = new ArrayList<>();
|
|
|
|
+ //危重患者应该有的查房记录的日期天
|
|
|
|
+ List<Integer> criticallyDay = new ArrayList<>();
|
|
|
|
+ Date criticallyStartDate = null, criticallyEndDate = null;
|
|
|
|
+ String recordTime = "", content = "";
|
|
|
|
+ List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();//查房记录
|
|
|
|
+ for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
|
|
|
|
+ Map<String, String> rescueStructureMap = threeLevelWardDoc.getStructureMap();
|
|
|
|
+ recordTime = rescueStructureMap.get("查房日期");
|
|
|
|
+ content = CatalogueUtil.subTitle(rescueStructureMap.get("病情记录"));
|
|
|
|
+ Date recordDate = StringUtil.parseDateTime(recordTime);
|
|
|
|
+ if (recordDate == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (content.contains("病重") || content.contains("病危")) {
|
|
|
|
+ criticallyStartDate = recordDate;
|
|
|
|
+ } else if (content.contains("病情稳定") || content.contains("病情好转")) {
|
|
|
|
+ criticallyEndDate = recordDate;
|
|
|
|
+ }
|
|
|
|
+ dateRecordDay.add(DateUtil.getDay(recordDate));
|
|
|
|
+ }
|
|
|
|
+ if (criticallyStartDate == null || criticallyEndDate == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ int daynum = DateUtil.getDay(criticallyEndDate) - DateUtil.getDay(criticallyStartDate);
|
|
|
|
+ for (int i = 1; i <= daynum; i++) {
|
|
|
|
+ if (i % 2 == 0) {
|
|
|
|
+ int wardDay = DateUtil.getDay(DateUtil.addDate(criticallyStartDate, i));
|
|
|
|
+ criticallyDay.add(wardDay);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!dateRecordDay.containsAll(criticallyDay)) {
|
|
|
|
+ status.set("-1");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|