|
|
|
@ -20,11 +20,12 @@ import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检验报告采集
|
|
|
|
|
*
|
|
|
|
|
* @author wyb
|
|
|
|
|
*/
|
|
|
|
|
@Component("LisSystemCollector")
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class LisSystemCollector{
|
|
|
|
|
public class LisSystemCollector {
|
|
|
|
|
@Value("${docus.report.lis.url}")
|
|
|
|
|
private String url;
|
|
|
|
|
@Value("${docus.report.lis.assortId}")
|
|
|
|
@ -41,15 +42,20 @@ public class LisSystemCollector{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 采集检验报告的参数
|
|
|
|
|
* @param basic 患者信息
|
|
|
|
|
*
|
|
|
|
|
* @param basic 患者信息
|
|
|
|
|
* @param beginDateTime 报告开始时间
|
|
|
|
|
* @param endDateTime 报告结束时间
|
|
|
|
|
* @param endDateTime 报告结束时间
|
|
|
|
|
*/
|
|
|
|
|
public void collect(TBasic basic, String beginDateTime, String endDateTime){
|
|
|
|
|
String collectData = collectData(basic, beginDateTime, endDateTime);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDTOList = LisSystemCollectConverter.convert(collectData);
|
|
|
|
|
public void collect(TBasic basic, String beginDateTime, String endDateTime) {
|
|
|
|
|
// 普通的检验报告和 微生物检验报告
|
|
|
|
|
String collectDataNormal = collectData(basic, beginDateTime, endDateTime, 0);
|
|
|
|
|
String collectDataMtf = collectData(basic, beginDateTime, endDateTime, 1);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDTOList = LisSystemCollectConverter.convert(collectDataNormal);
|
|
|
|
|
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
|
|
|
|
|
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
|
|
|
|
|
for (ReportFileInfoDTO reportFileInfoDTO : reportFileInfoDTOList) {
|
|
|
|
|
if(!isBelongToPatient(reportFileInfoDTO,basic)){
|
|
|
|
|
if (!isBelongToPatient(reportFileInfoDTO, basic)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
reportFileInfoDTO.setPatientId(basic.getPatientId());
|
|
|
|
@ -64,9 +70,18 @@ public class LisSystemCollector{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String collectData(TBasic basic,String beginDateTime,String endDateTime){
|
|
|
|
|
/**
|
|
|
|
|
* 查询检验报告
|
|
|
|
|
*
|
|
|
|
|
* @param basic 患者信息
|
|
|
|
|
* @param beginDateTime 报告开始时间 入院时间
|
|
|
|
|
* @param endDateTime 报告结束时间 出院时间
|
|
|
|
|
* @param microbeTestFlag 查细菌等微生物检验报告 1,空和0 是普通
|
|
|
|
|
* @return 检验报告结果
|
|
|
|
|
*/
|
|
|
|
|
public String collectData(TBasic basic, String beginDateTime, String endDateTime, int microbeTestFlag) {
|
|
|
|
|
String contextWorkId = Func.randomUUID();
|
|
|
|
|
Object[] params = createQrParams(basic, beginDateTime, endDateTime);
|
|
|
|
|
Object[] params = createQrParams(basic, beginDateTime, endDateTime, microbeTestFlag);
|
|
|
|
|
log.info("[{}]:LIS检验报告采集地址:{},方法:{},命名空间:{},参数:{}", contextWorkId, url, method, namespaceUri, Func.toJson(params));
|
|
|
|
|
String result = JaxWsDynamicClientUtil.send(url, namespaceUri, method, params);
|
|
|
|
|
log.info("[{}]:LIS检验报告采集结果为:{}", contextWorkId, result);
|
|
|
|
@ -75,13 +90,15 @@ public class LisSystemCollector{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询检验报告的ws参数
|
|
|
|
|
* @param basic 患者信息
|
|
|
|
|
* @param beginDateTime 报告开始时间
|
|
|
|
|
* @param endDateTime 报告结束时间
|
|
|
|
|
*
|
|
|
|
|
* @param basic 患者信息
|
|
|
|
|
* @param beginDateTime 报告开始时间
|
|
|
|
|
* @param endDateTime 报告结束时间
|
|
|
|
|
* @param microbeTestFlag 查细菌等微生物检验报告 1,空和0 是普通
|
|
|
|
|
* @return 检验报告
|
|
|
|
|
*/
|
|
|
|
|
private Object[] createQrParams(TBasic basic,String beginDateTime,String endDateTime) {
|
|
|
|
|
String param1="<ESBEntry>" +
|
|
|
|
|
private Object[] createQrParams(TBasic basic, String beginDateTime, String endDateTime, int microbeTestFlag) {
|
|
|
|
|
String param1 = "<ESBEntry>" +
|
|
|
|
|
" <AccessControl>" +
|
|
|
|
|
" <SysFlag>1</SysFlag>" +
|
|
|
|
|
" <UserName>WZHBAGL</UserName>" +
|
|
|
|
@ -95,7 +112,7 @@ public class LisSystemCollector{
|
|
|
|
|
" <OrderNo>BS03102S51001</OrderNo>" +
|
|
|
|
|
" <SourceSysCode>S51</SourceSysCode>" +
|
|
|
|
|
" <TargetSysCode>S00</TargetSysCode>" +
|
|
|
|
|
" <MsgDate>"+Func.formatDateTime(LocalDateTime.now())+"</MsgDate>" +
|
|
|
|
|
" <MsgDate>" + Func.formatDateTime(LocalDateTime.now()) + "</MsgDate>" +
|
|
|
|
|
" </MessageHeader>" +
|
|
|
|
|
" <RequestOption>" +
|
|
|
|
|
" <triggerData>0</triggerData>" +
|
|
|
|
@ -114,12 +131,11 @@ public class LisSystemCollector{
|
|
|
|
|
" <OUTHOSP_NO/>" +
|
|
|
|
|
" <INHOSP_INDEX_NO/>" +
|
|
|
|
|
" <INHOSP_NO/>" +
|
|
|
|
|
" <EMPI_ID>"+basic.getEmpId()+"</EMPI_ID/>" +
|
|
|
|
|
" <EMPI_ID>" + basic.getEmpId() + "</EMPI_ID/>" +
|
|
|
|
|
" <TEST_PAT_SOURCE_CODE/>" +
|
|
|
|
|
" <MICROBE_TEST_FLAG>" +
|
|
|
|
|
" </MICROBE_TEST_FLAG>" +
|
|
|
|
|
" <BEGIN_DATETIME>"+beginDateTime+"</BEGIN_DATETIME>" +
|
|
|
|
|
" <END_DATETIME>"+endDateTime+"</END_DATETIME>" +
|
|
|
|
|
" <MICROBE_TEST_FLAG>" + microbeTestFlag + "</MICROBE_TEST_FLAG>" +
|
|
|
|
|
" <BEGIN_DATETIME>" + beginDateTime + "</BEGIN_DATETIME>" +
|
|
|
|
|
" <END_DATETIME>" + endDateTime + "</END_DATETIME>" +
|
|
|
|
|
" </Msg>" +
|
|
|
|
|
" </Request>" +
|
|
|
|
|
" </content>" +
|
|
|
|
@ -129,44 +145,45 @@ public class LisSystemCollector{
|
|
|
|
|
" <AS ID=\"\" linkField=\"\"/>" +
|
|
|
|
|
" </GroupInfo>" +
|
|
|
|
|
"</ESBEntry>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new Object[]{param1};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static class LisSystemCollectConverter{
|
|
|
|
|
private static class LisSystemCollectConverter {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检验系统报告采集数据转换文件上报信息
|
|
|
|
|
*
|
|
|
|
|
* @param lisSystemCollectData 验系统报告采集数据
|
|
|
|
|
* @return 文件上报信息
|
|
|
|
|
*/
|
|
|
|
|
public static List<ReportFileInfoDTO> convert(String lisSystemCollectData) {
|
|
|
|
|
XmlUtil xmlUtil = XmlUtil.of(lisSystemCollectData);
|
|
|
|
|
List<ReportFileInfoDTO> list= new ArrayList<>();
|
|
|
|
|
List<ReportFileInfoDTO> list = new ArrayList<>();
|
|
|
|
|
NodeList reportInfoNodeList = xmlUtil.getNodeList("/Response/MsgInfo/Msg/ReportInfo");
|
|
|
|
|
if(reportInfoNodeList!=null && reportInfoNodeList.getLength()>0){
|
|
|
|
|
if (reportInfoNodeList != null && reportInfoNodeList.getLength() > 0) {
|
|
|
|
|
int length = reportInfoNodeList.getLength();
|
|
|
|
|
for (int i = 0; i < length; i++) {
|
|
|
|
|
Node item = reportInfoNodeList.item(i);
|
|
|
|
|
NodeList childNodes = item.getChildNodes();
|
|
|
|
|
int childNodesLength = childNodes.getLength();
|
|
|
|
|
String fileTitle=null;
|
|
|
|
|
String serialNum=null;
|
|
|
|
|
String downUrl=null;
|
|
|
|
|
String fileTitle = null;
|
|
|
|
|
String serialNum = null;
|
|
|
|
|
String downUrl = null;
|
|
|
|
|
for (int j = 0; j < childNodesLength; j++) {
|
|
|
|
|
Node childNodeItem = childNodes.item(j);
|
|
|
|
|
if ("TEST_CATEG_NAME".equals(childNodeItem.getNodeName())) {
|
|
|
|
|
fileTitle=childNodeItem.getTextContent();
|
|
|
|
|
fileTitle = childNodeItem.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
// if ("TEST_CATEG_NAME".equals(childNodeItem.getNodeName())) {
|
|
|
|
|
// fileTitle=childNodeItem.getTextContent();
|
|
|
|
|
// }
|
|
|
|
|
if ("SAMPLE_NO".equals(childNodeItem.getNodeName())) {
|
|
|
|
|
serialNum=childNodeItem.getTextContent();
|
|
|
|
|
serialNum = childNodeItem.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
if ("REPORT_URL".equals(childNodeItem.getNodeName())) {
|
|
|
|
|
downUrl=childNodeItem.getTextContent();
|
|
|
|
|
downUrl = childNodeItem.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -187,5 +204,4 @@ public class LisSystemCollector{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|