|
@@ -1,6 +1,7 @@
|
|
package com.lantone.qc.kernel.catalogue.threelevelward;
|
|
package com.lantone.qc.kernel.catalogue.threelevelward;
|
|
|
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
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.InputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
|
|
import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
|
|
@@ -8,6 +9,7 @@ import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
import com.lantone.qc.pub.util.DateUtil;
|
|
import com.lantone.qc.pub.util.DateUtil;
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -30,12 +32,25 @@ public class THR03024 extends QCCatalogue {
|
|
* 1、有病危医嘱、查房记录。
|
|
* 1、有病危医嘱、查房记录。
|
|
* 2、第一个危重医嘱的开始时间当天有查房记录,结束时间有查房记录。
|
|
* 2、第一个危重医嘱的开始时间当天有查房记录,结束时间有查房记录。
|
|
* 3、每天有查房记录。
|
|
* 3、每天有查房记录。
|
|
|
|
+ * 4、如果医嘱结束时间大于出院时间,那以出院时间为结束时间
|
|
|
|
+ * 5、首程也算第一次查房
|
|
*/
|
|
*/
|
|
status.set("0");
|
|
status.set("0");
|
|
if (ListUtil.isEmpty(inputInfo.getDoctorAdviceDocs()) ||
|
|
if (ListUtil.isEmpty(inputInfo.getDoctorAdviceDocs()) ||
|
|
ListUtil.isEmpty(inputInfo.getThreeLevelWardDocs())) {
|
|
ListUtil.isEmpty(inputInfo.getThreeLevelWardDocs())) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ String leaveDateString = "";
|
|
|
|
+ Date leaveDate = null;
|
|
|
|
+ if (inputInfo.getLeaveHospitalDoc() != null) {
|
|
|
|
+ leaveDateString = inputInfo.getLeaveHospitalDoc().getStructureMap().get("出院时间");
|
|
|
|
+ } else if (inputInfo.getDeathRecordDoc() != null) {
|
|
|
|
+ leaveDateString = inputInfo.getDeathRecordDoc().getStructureMap().get("死亡时间");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(leaveDateString)) {
|
|
|
|
+ leaveDate = StringUtil.parseDateTime(leaveDateString);
|
|
|
|
+ }
|
|
|
|
+
|
|
List<DoctorAdviceDoc> doctorAdviceDocList = inputInfo.getDoctorAdviceDocs();
|
|
List<DoctorAdviceDoc> doctorAdviceDocList = inputInfo.getDoctorAdviceDocs();
|
|
List<List<Date>> doctorAdviceDate = new ArrayList<>();
|
|
List<List<Date>> doctorAdviceDate = new ArrayList<>();
|
|
|
|
|
|
@@ -49,6 +64,10 @@ public class THR03024 extends QCCatalogue {
|
|
if (StringUtil.isNotBlank(startDateStr) && StringUtil.isNotBlank(endDateStr)) {
|
|
if (StringUtil.isNotBlank(startDateStr) && StringUtil.isNotBlank(endDateStr)) {
|
|
Date startDate = StringUtil.parseDateTime(startDateStr);
|
|
Date startDate = StringUtil.parseDateTime(startDateStr);
|
|
Date endDate = StringUtil.parseDateTime(endDateStr);
|
|
Date endDate = StringUtil.parseDateTime(endDateStr);
|
|
|
|
+ //如果医嘱结束时间大于出院时间,那以出院时间为结束时间
|
|
|
|
+ if (leaveDate != null && leaveDate.before(endDate)) {
|
|
|
|
+ endDate = leaveDate;
|
|
|
|
+ }
|
|
if (startDate.before(endDate)) {
|
|
if (startDate.before(endDate)) {
|
|
List<Date> listDate = new ArrayList<>();
|
|
List<Date> listDate = new ArrayList<>();
|
|
listDate.add(DateUtil.dateZeroClear(startDate));
|
|
listDate.add(DateUtil.dateZeroClear(startDate));
|
|
@@ -69,8 +88,16 @@ public class THR03024 extends QCCatalogue {
|
|
for (ThreeLevelWardDoc threeLevelWardDoc : allDoctorWradDocs) {
|
|
for (ThreeLevelWardDoc threeLevelWardDoc : allDoctorWradDocs) {
|
|
Map<String, String> rescueStructureMap = threeLevelWardDoc.getStructureMap();
|
|
Map<String, String> rescueStructureMap = threeLevelWardDoc.getStructureMap();
|
|
String recordTime = rescueStructureMap.get("查房日期");
|
|
String recordTime = rescueStructureMap.get("查房日期");
|
|
- Date recordDate = StringUtil.parseDateTime(recordTime);
|
|
|
|
- if (recordDate != null) {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(recordTime)) {
|
|
|
|
+ Date recordDate = StringUtil.parseDateTime(recordTime);
|
|
|
|
+ dateRecordDay.add(DateUtil.dateZeroClear(recordDate));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //首程也算第一次查房
|
|
|
|
+ if (inputInfo.getFirstCourseRecordDoc() != null) {
|
|
|
|
+ String recordTime = inputInfo.getFirstCourseRecordDoc().getStructureMap().get("病历日期");
|
|
|
|
+ if (StringUtils.isNotEmpty(recordTime)) {
|
|
|
|
+ Date recordDate = StringUtil.parseDateTime(recordTime);
|
|
dateRecordDay.add(DateUtil.dateZeroClear(recordDate));
|
|
dateRecordDay.add(DateUtil.dateZeroClear(recordDate));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -95,20 +122,23 @@ public class THR03024 extends QCCatalogue {
|
|
|
|
|
|
// 医嘱开始时间当天有查房记录
|
|
// 医嘱开始时间当天有查房记录
|
|
if (!dateRecordDay.contains(doctorDateStart)) {
|
|
if (!dateRecordDay.contains(doctorDateStart)) {
|
|
|
|
+ info.set(DateUtil.formatDate(doctorDateStart));
|
|
status.set("-1");
|
|
status.set("-1");
|
|
return ;
|
|
return ;
|
|
}
|
|
}
|
|
// 医嘱结束时间当天有查房记录
|
|
// 医嘱结束时间当天有查房记录
|
|
if (!dateRecordDay.contains(doctorDateEnd)) {
|
|
if (!dateRecordDay.contains(doctorDateEnd)) {
|
|
|
|
+ info.set(DateUtil.formatDate(doctorDateEnd));
|
|
status.set("-1");
|
|
status.set("-1");
|
|
return ;
|
|
return ;
|
|
}
|
|
}
|
|
Date nextDate = doctorDateStart;
|
|
Date nextDate = doctorDateStart;
|
|
int returnFlag = 0; // 防止出现死循环系统崩溃
|
|
int returnFlag = 0; // 防止出现死循环系统崩溃
|
|
|
|
+ String infoStr = "";
|
|
while(returnFlag <= 1000) {
|
|
while(returnFlag <= 1000) {
|
|
if (!dateRecordDay.contains(nextDate)) {
|
|
if (!dateRecordDay.contains(nextDate)) {
|
|
status.set("-1");
|
|
status.set("-1");
|
|
- return ;
|
|
|
|
|
|
+ infoStr = CatalogueUtil.concatInfo(infoStr, DateUtil.formatDate(nextDate));
|
|
}
|
|
}
|
|
nextDate = DateUtil.addDate(nextDate, 1);
|
|
nextDate = DateUtil.addDate(nextDate, 1);
|
|
if (nextDate.after(doctorDateEnd)) {
|
|
if (nextDate.after(doctorDateEnd)) {
|
|
@@ -116,5 +146,8 @@ public class THR03024 extends QCCatalogue {
|
|
}
|
|
}
|
|
returnFlag++; // 防止出现死循环系统崩溃
|
|
returnFlag++; // 防止出现死循环系统崩溃
|
|
}
|
|
}
|
|
|
|
+ if (StringUtils.isNotEmpty(infoStr)) {
|
|
|
|
+ info.set(infoStr);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|