|
|
|
|
@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
@ -173,10 +174,30 @@ public class ReportCollectServiceImpl implements ReportCollectService {
|
|
|
|
|
log.error("采集LIS报告,患者:{},住院流水号:{},入院、出院时间,empId有空数据,无法采集!", basic.getInpatientNo(), jzh);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String beginDate = Func.formatDate(admissDate);
|
|
|
|
|
String endDate = Func.formatDate(disDate);
|
|
|
|
|
GdSzyZhReportListDto lisList = gdSzyZhReportService.lisList(empId, jzh, beginDate, endDate);
|
|
|
|
|
List<GdSzyZhReportListDto.Report> reportList = lisList.getReportList();
|
|
|
|
|
List<GdSzyZhReportListDto.Report> reportList = new ArrayList<>();
|
|
|
|
|
String admissDateFormat = Func.formatDate(admissDate);
|
|
|
|
|
String disDateFormat = Func.formatDate(disDate);
|
|
|
|
|
int intervalDays = 20;
|
|
|
|
|
LocalDate beginDate = Func.parseDate(admissDateFormat);
|
|
|
|
|
LocalDate stopEndDate = Func.parseDate(disDateFormat).plusDays(15);
|
|
|
|
|
// 因为报告时间过长,LIS系统会响应超时,分时间段查询,intervalDays 天一组。
|
|
|
|
|
while (true) {
|
|
|
|
|
if(beginDate.isAfter(stopEndDate)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
LocalDate endDate = beginDate.plusDays(intervalDays);
|
|
|
|
|
if (endDate.isAfter(stopEndDate)) {
|
|
|
|
|
endDate = stopEndDate;
|
|
|
|
|
}
|
|
|
|
|
GdSzyZhReportListDto dto = gdSzyZhReportService.lisList(empId, jzh, beginDate + " 00:00:00", endDate + " 23:59:59");
|
|
|
|
|
List<GdSzyZhReportListDto.Report> reports = dto.getReportList();
|
|
|
|
|
reportList.addAll(reports);
|
|
|
|
|
// 截止
|
|
|
|
|
if (endDate.isEqual(stopEndDate) || endDate.isAfter(stopEndDate)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
beginDate = endDate.plusDays(1);
|
|
|
|
|
}
|
|
|
|
|
reportList = reportList.stream()
|
|
|
|
|
.sorted(Comparator.comparing(GdSzyZhReportListDto.Report::getReportClass)
|
|
|
|
|
.thenComparing(GdSzyZhReportListDto.Report::getReportTime))
|
|
|
|
|
|