|
|
|
@ -21,6 +21,7 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检验报告采集
|
|
|
|
@ -44,6 +45,9 @@ public class LisSystemCollector {
|
|
|
|
|
@Autowired
|
|
|
|
|
private FileReportService fileReportService;
|
|
|
|
|
|
|
|
|
|
@Value("${docus.report.lis.incrDays:}")
|
|
|
|
|
private String incrDays;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 采集检验报告的参数
|
|
|
|
|
*
|
|
|
|
@ -62,11 +66,44 @@ public class LisSystemCollector {
|
|
|
|
|
LocalDateTime endLocalDateTime = Func.parseDateTime(disDate).plusDays(15L);
|
|
|
|
|
String endDateTime = Func.formatDateTime(endLocalDateTime);
|
|
|
|
|
// 普通的检验报告和 微生物检验报告
|
|
|
|
|
String collectDataNormal = collectData(new Jzh(jzh), beginDateTime, endDateTime, 0);
|
|
|
|
|
String collectDataMtf = collectData(new Jzh(jzh), beginDateTime, endDateTime, 1);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDTOList = LisSystemCollectConverter.convert(collectDataNormal);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
|
|
|
|
|
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDTOList = new ArrayList<>();
|
|
|
|
|
if (Func.isNotBlank(incrDays)) {
|
|
|
|
|
LocalDateTime qrBeginLocalDateTime = Func.parseDateTime(beginDateTime);
|
|
|
|
|
int limitDays = Integer.parseInt(incrDays);
|
|
|
|
|
while (true) {
|
|
|
|
|
LocalDateTime qrEndLocalDateTime = qrBeginLocalDateTime.plusDays(limitDays);
|
|
|
|
|
if (qrBeginLocalDateTime.isAfter(endLocalDateTime)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
boolean endFlag = false;
|
|
|
|
|
if (qrEndLocalDateTime.isAfter(endLocalDateTime)) {
|
|
|
|
|
qrEndLocalDateTime = endLocalDateTime;
|
|
|
|
|
endFlag = true;
|
|
|
|
|
}
|
|
|
|
|
String qrBeginDateTime = Func.formatDateTime(qrBeginLocalDateTime);
|
|
|
|
|
String qrEndDateTime = Func.formatDateTime(qrEndLocalDateTime);
|
|
|
|
|
String collectDataNormal = collectData(new Jzh(jzh), qrBeginDateTime, qrEndDateTime, 0);
|
|
|
|
|
String collectDataMtf = collectData(new Jzh(jzh), qrBeginDateTime, qrEndDateTime, 1);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList1 = LisSystemCollectConverter.convert(collectDataNormal);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList1);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
|
|
|
|
|
if (endFlag) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
qrBeginLocalDateTime = qrEndLocalDateTime;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
String collectDataNormal = collectData(new Jzh(jzh), beginDateTime, endDateTime, 0);
|
|
|
|
|
String collectDataMtf = collectData(new Jzh(jzh), beginDateTime, endDateTime, 1);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList1 = LisSystemCollectConverter.convert(collectDataNormal);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList1);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (ReportFileInfoDTO reportFileInfoDTO : reportFileInfoDTOList) {
|
|
|
|
|
if (!isBelongToPatient(reportFileInfoDTO, basic)) {
|
|
|
|
|
continue;
|
|
|
|
@ -101,12 +138,44 @@ public class LisSystemCollector {
|
|
|
|
|
LocalDateTime endLocalDateTime = Func.parseDateTime(disDateStr).plusDays(15L);
|
|
|
|
|
endDateTime = Func.formatDateTime(endLocalDateTime);
|
|
|
|
|
}
|
|
|
|
|
LocalDateTime endLocalDateTime = Func.parseDateTime(endDateTime);
|
|
|
|
|
// 普通的检验报告和 微生物检验报告
|
|
|
|
|
String collectDataNormal = collectData(new Jzh(jzh), beginDateTime, endDateTime, 0);
|
|
|
|
|
String collectDataMtf = collectData(new Jzh(jzh), beginDateTime, endDateTime, 1);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDTOList = LisSystemCollectConverter.convert(collectDataNormal);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDTOList = new ArrayList<>();
|
|
|
|
|
if (Func.isNotBlank(incrDays)) {
|
|
|
|
|
LocalDateTime qrBeginLocalDateTime = Func.parseDateTime(beginDateTime);
|
|
|
|
|
int limitDays = Integer.parseInt(incrDays);
|
|
|
|
|
while (true) {
|
|
|
|
|
LocalDateTime qrEndLocalDateTime = qrBeginLocalDateTime.plusDays(limitDays);
|
|
|
|
|
if (qrBeginLocalDateTime.isAfter(endLocalDateTime)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
boolean endFlag = false;
|
|
|
|
|
if (qrEndLocalDateTime.isAfter(endLocalDateTime)) {
|
|
|
|
|
qrEndLocalDateTime = endLocalDateTime;
|
|
|
|
|
endFlag = true;
|
|
|
|
|
}
|
|
|
|
|
String qrBeginDateTime = Func.formatDateTime(qrBeginLocalDateTime);
|
|
|
|
|
String qrEndDateTime = Func.formatDateTime(qrEndLocalDateTime);
|
|
|
|
|
String collectDataNormal = collectData(new Jzh(jzh), qrBeginDateTime, qrEndDateTime, 0);
|
|
|
|
|
String collectDataMtf = collectData(new Jzh(jzh), qrBeginDateTime, qrEndDateTime, 1);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList1 = LisSystemCollectConverter.convert(collectDataNormal);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList1);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
|
|
|
|
|
if (endFlag) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
qrBeginLocalDateTime = qrEndLocalDateTime;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
String collectDataNormal = collectData(new Jzh(jzh), beginDateTime, endDateTime, 0);
|
|
|
|
|
String collectDataMtf = collectData(new Jzh(jzh), beginDateTime, endDateTime, 1);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList1 = LisSystemCollectConverter.convert(collectDataNormal);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList1);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (ReportFileInfoDTO reportFileInfoDTO : reportFileInfoDTOList) {
|
|
|
|
|
reportFileInfoDTO.setPatientId(tSeal.getPatientId());
|
|
|
|
|
reportFileInfoDTO.setAssortId(assortId);
|
|
|
|
@ -282,54 +351,36 @@ public class LisSystemCollector {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
String param1 = "<ESBEntry>" +
|
|
|
|
|
" <AccessControl>" +
|
|
|
|
|
" <SysFlag>1</SysFlag>" +
|
|
|
|
|
" <UserName>WZHBAGL</UserName>" +
|
|
|
|
|
" <Password>WZHBAGL_1127</Password>" +
|
|
|
|
|
" <Fid>BS03102</Fid>" +
|
|
|
|
|
" <OrderNo>BS03102S51001</OrderNo>" +
|
|
|
|
|
" <SUBOR_HOSPITAL_DISTRICT>GZ</SUBOR_HOSPITAL_DISTRICT>" +
|
|
|
|
|
" </AccessControl>" +
|
|
|
|
|
" <MessageHeader>" +
|
|
|
|
|
" <Fid>BS03102</Fid>" +
|
|
|
|
|
" <OrderNo>BS03102S51001</OrderNo>" +
|
|
|
|
|
" <SourceSysCode>S51</SourceSysCode>" +
|
|
|
|
|
" <TargetSysCode>S00</TargetSysCode>" +
|
|
|
|
|
" <MsgDate>" + "2025-03-14 00:50:29" + "</MsgDate>" +
|
|
|
|
|
" </MessageHeader>" +
|
|
|
|
|
" <RequestOption>" +
|
|
|
|
|
" <triggerData>0</triggerData>" +
|
|
|
|
|
" <dataAmount>500</dataAmount>" +
|
|
|
|
|
" </RequestOption>" +
|
|
|
|
|
" <MsgInfo flag=\"1\">" +
|
|
|
|
|
" <Msg/>" +
|
|
|
|
|
" <distinct value=\"0\"/>" +
|
|
|
|
|
" <query item=\"WS_INPUT\" compy=\" = \" value=\" 1 \" splice=\"AND\"/>" +
|
|
|
|
|
" <query_ws action=\"Q_WS_JYBGLBCX\">" +
|
|
|
|
|
" <content>" +
|
|
|
|
|
" <Request>" +
|
|
|
|
|
" <Msg>" +
|
|
|
|
|
" <VUID/>" +
|
|
|
|
|
" <OUTHOSP_INDEX_NO/>" +
|
|
|
|
|
" <OUTHOSP_NO/>" +
|
|
|
|
|
" <INHOSP_INDEX_NO/>" +
|
|
|
|
|
" <INHOSP_NO>" + "17762804477" + "</INHOSP_NO>" +
|
|
|
|
|
" <EMPI_ID/>" +
|
|
|
|
|
" <TEST_PAT_SOURCE_CODE/>" +
|
|
|
|
|
" <MICROBE_TEST_FLAG>" + 0 + "</MICROBE_TEST_FLAG>" +
|
|
|
|
|
" <BEGIN_DATETIME>" + "2025-01-21 12:10:54" + "</BEGIN_DATETIME>" +
|
|
|
|
|
" <END_DATETIME>" + "2025-03-14 10:00:00" + "</END_DATETIME>" +
|
|
|
|
|
" </Msg>" +
|
|
|
|
|
" </Request>" +
|
|
|
|
|
" </content>" +
|
|
|
|
|
" </query_ws>" +
|
|
|
|
|
" </MsgInfo>" +
|
|
|
|
|
" <GroupInfo flag=\"0\">" +
|
|
|
|
|
" <AS ID=\"\" linkField=\"\"/>" +
|
|
|
|
|
" </GroupInfo>" +
|
|
|
|
|
"</ESBEntry>";
|
|
|
|
|
System.out.println(param1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String beginDateTime = "2025-02-06 19:48:52";
|
|
|
|
|
LocalDateTime endLocalDateTime = Func.parseDateTime("2025-04-04 12:00:00").plusDays(15L);
|
|
|
|
|
String endDateTime = Func.formatDateTime(endLocalDateTime);
|
|
|
|
|
// 普通的检验报告和 微生物检验报告
|
|
|
|
|
LocalDateTime qrBeginLocalDateTime = Func.parseDateTime(beginDateTime);
|
|
|
|
|
int limitDays = 10;
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDTOList = new ArrayList<>();
|
|
|
|
|
while (true) {
|
|
|
|
|
LocalDateTime qrEndLocalDateTime = qrBeginLocalDateTime.plusDays(limitDays);
|
|
|
|
|
if (qrBeginLocalDateTime.isAfter(endLocalDateTime)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
boolean endFlag = false;
|
|
|
|
|
if (qrEndLocalDateTime.isAfter(endLocalDateTime)) {
|
|
|
|
|
qrEndLocalDateTime = endLocalDateTime;
|
|
|
|
|
endFlag = true;
|
|
|
|
|
}
|
|
|
|
|
System.out.println(Func.formatDateTime(qrBeginLocalDateTime) + ">>>>>>>" + Func.formatDateTime(qrEndLocalDateTime));
|
|
|
|
|
if (endFlag) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
qrBeginLocalDateTime = qrEndLocalDateTime;
|
|
|
|
|
try {
|
|
|
|
|
TimeUnit.MILLISECONDS.sleep(500);
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class LisSystemCollectConverter {
|
|
|
|
|