|
@@ -4,15 +4,19 @@ 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.StagesSummaryDoc;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.operation.OperationDoc;
|
|
|
+import com.lantone.qc.pub.model.doc.transferrecord.TransferIntoDoc;
|
|
|
+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.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @ClassName : THR0588
|
|
@@ -24,7 +28,6 @@ import java.util.Map;
|
|
|
public class THR0588 extends QCCatalogue {
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
-
|
|
|
Date leaveDate = null;
|
|
|
if (inputInfo.getMedicalRecordInfoDoc() != null) {
|
|
|
Map<String, String> medicalRecordInfoStructureMap = inputInfo.getMedicalRecordInfoDoc().getStructureMap();
|
|
@@ -36,7 +39,6 @@ public class THR0588 extends QCCatalogue {
|
|
|
if (threeLevelWardDocs.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
//所有查房记录的日期天
|
|
|
List<Date> dateThreeLevelDay = new ArrayList<>();
|
|
|
StringBuffer sb = new StringBuffer();
|
|
@@ -49,6 +51,57 @@ public class THR0588 extends QCCatalogue {
|
|
|
}
|
|
|
dateThreeLevelDay.add(threeLevelDate);
|
|
|
}
|
|
|
+ /******************************************术后首程********************************************************/
|
|
|
+ if (inputInfo.getOperationDocs().size() > 0) {
|
|
|
+ List<String> recordDateList = inputInfo.getOperationDocs().stream().map(OperationDoc::getOperationDiscussionDoc).filter(Objects::nonNull)
|
|
|
+ .map(OperationDiscussionDoc::getStructureMap).filter(i -> StringUtil.isNotBlank(i.get("记录日期")))
|
|
|
+ .map(i -> i.get("记录日期")).collect(Collectors.toList());
|
|
|
+ for (String recordDateStr : recordDateList) {
|
|
|
+ Date recordDate = StringUtil.parseDateTime(recordDateStr);
|
|
|
+ if (recordDate == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ dateThreeLevelDay.add(recordDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /******************************************转入转出********************************************************/
|
|
|
+ if (inputInfo.getTransferRecordDocs() != null) {
|
|
|
+ TransferRecordDoc transferRecordDocs = inputInfo.getTransferRecordDocs();
|
|
|
+ List<String> intoRecordDateList = transferRecordDocs.getTransferIntoDocs()
|
|
|
+ .stream().map(TransferIntoDoc::getStructureMap).filter(i -> StringUtil.isNotBlank(i.get("记录日期")))
|
|
|
+ .map(i -> i.get("记录日期")).collect(Collectors.toList());
|
|
|
+ for (String recordDateStr : intoRecordDateList) {
|
|
|
+ Date recordDate = StringUtil.parseDateTime(recordDateStr);
|
|
|
+ if (recordDate == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ dateThreeLevelDay.add(recordDate);
|
|
|
+ }
|
|
|
+ intoRecordDateList = transferRecordDocs.getTransferOutDocs()
|
|
|
+ .stream().map(TransferOutDoc::getStructureMap).filter(i -> StringUtil.isNotBlank(i.get("记录日期")))
|
|
|
+ .map(i -> i.get("记录日期")).collect(Collectors.toList());
|
|
|
+ for (String recordDateStr : intoRecordDateList) {
|
|
|
+ Date recordDate = StringUtil.parseDateTime(recordDateStr);
|
|
|
+ if (recordDate == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ dateThreeLevelDay.add(recordDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /******************************************阶段小结********************************************************/
|
|
|
+ if (inputInfo.getStagesSummaryDocs().size() > 0) {
|
|
|
+ List<String> intoRecordDateList = inputInfo.getStagesSummaryDocs().stream().map(StagesSummaryDoc::getStructureMap)
|
|
|
+ .filter(i -> StringUtil.isNotBlank(i.get("记录日期")))
|
|
|
+ .map(i -> i.get("记录日期")).collect(Collectors.toList());
|
|
|
+ for (String recordDateStr : intoRecordDateList) {
|
|
|
+ Date recordDate = StringUtil.parseDateTime(recordDateStr);
|
|
|
+ if (recordDate == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ dateThreeLevelDay.add(recordDate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dateThreeLevelDay = dateThreeLevelDay.stream().sorted().collect(Collectors.toList());
|
|
|
//获取连续3天无查房记录的时间
|
|
|
for (int i = 0; i < dateThreeLevelDay.size(); i++) {
|
|
|
if (i + 1 < dateThreeLevelDay.size()) {
|