From 9f7e53a0500692ead0b2d8a76c5ce62ff9c20231 Mon Sep 17 00:00:00 2001 From: wyb <1977763549@qq.com> Date: Wed, 1 Nov 2023 14:56:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A9=B4=E5=84=BF=E7=9A=84=E6=8A=A4=E7=90=86?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=8C=E4=B8=8D=E6=A0=A1=E9=AA=8C=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E6=80=A7=EF=BC=8C=E6=96=87=E4=BB=B6=E4=BC=A0=E7=BB=99?= =?UTF-8?q?=E6=AF=8D=E4=BA=B2=EF=BC=8C=E6=9D=A5=E6=BA=90=E5=8A=A0=5FB?= =?UTF-8?q?=E5=90=8E=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/config/SdRyReportQueryConfig.java | 10 ++++++++-- .../com/docus/server/report/job/ReportJob.java | 18 +++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/docus/server/report/config/SdRyReportQueryConfig.java b/src/main/java/com/docus/server/report/config/SdRyReportQueryConfig.java index fe54f67..f1b0600 100644 --- a/src/main/java/com/docus/server/report/config/SdRyReportQueryConfig.java +++ b/src/main/java/com/docus/server/report/config/SdRyReportQueryConfig.java @@ -14,6 +14,12 @@ import org.springframework.stereotype.Component; @Getter @Setter public class SdRyReportQueryConfig { + /** + * 同一个来源采集,区分婴儿来源的后缀 + */ + public static String BABY_COLLECTOR_ID_SUFFIX = "_B"; + + @Value("${sdry.report-index-query.wsdl-addr:}") private String queryReportIndexWsdlAddr; @Value("${sdry.report-index-query.namespace-uri:}") @@ -59,6 +65,8 @@ public class SdRyReportQueryConfig { private int reportQueryNurseInsertSugarInterval; @Value("${sdry.report-query-url.nurseInsertSugar.collectorId}") private String reportQueryNurseInsertSugarCollectorId; + + @Value("${sdry.report-query-url.nurseInsertSugar.defaultAssortType:other}") private String reportQueryNurseInsertSugarDefaultAssortType; @Value("${sdry.report-query-url.nurseInsertSugar.pushErr.url:}") @@ -67,8 +75,6 @@ public class SdRyReportQueryConfig { private int reportQueryNurseInsertSugarErrPushInterval; - - @Value("${sdry.report-query-url.blood.collectorId}") private String bloodCollectorId; @Value("${sdry.report-query-url.blood.url}") diff --git a/src/main/java/com/docus/server/report/job/ReportJob.java b/src/main/java/com/docus/server/report/job/ReportJob.java index fb53254..e498ce4 100644 --- a/src/main/java/com/docus/server/report/job/ReportJob.java +++ b/src/main/java/com/docus/server/report/job/ReportJob.java @@ -215,6 +215,7 @@ public class ReportJob { taskDistributeService.cancel(reportDownTwoDto.getTasks().get(0).getTaskId()); return; } + boolean babyTask = isBabyTask(reportDownTwoDto); String patientId = reportDownTwoDto.getPatient().getPatientId(); String inpatientNo = reportDownTwoDto.getPatient().getInpatientNo(); Integer admissTimes = reportDownTwoDto.getHospitals().get(0).getAdmissTimes(); @@ -269,13 +270,24 @@ public class ReportJob { reportDto.setDowntype(1); reportDto.setFileSource("1"); reportDto.setFilestoragetype("1"); + if (babyTask) { + // 婴儿任务,文件传到母亲病案,来源加后缀 + PatientInfoDTO parent = reportDownTwoDto.getParent(); + reportDto.setAdmisstimes(parent.getAdmissTimes()); + reportDto.setInpatientNo(parent.getInpatientNo()); + reportDto.setPatientId(parent.getPatientId()); + reportDto.setSysFlag(reportQueryNurseInsertSugarCollectorId+SdRyReportQueryConfig.BABY_COLLECTOR_ID_SUFFIX); + } reportService.report(reportDto); collectFileCount++; } log.info("住院号:{},住院次数{},护理采集文件: {} 条", inpatientNo, admissTimes, collectFileCount); + if (babyTask) { + return; + } // 设置一个redisKey,过期被监听处理 String redisKey = String.format(ReportDownloadWait.REPORT_DOWNLOAD_WAIT_KEY, reportQueryNurseInsertSugarCollectorId, patientId); - redisOps.setEx(redisKey, "0", waittime*60); + redisOps.setEx(redisKey, "0", waittime * 60); } } @@ -657,7 +669,7 @@ public class ReportJob { } - public String saveBase64(String base64) { + public String saveBase64(String base64) { String dir = createBase64SaveDir(); String base64File = dir + File.separator + idService.getDateSeq() + ".txt"; try (FileWriter fileWriter = new FileWriter(base64File); @@ -691,7 +703,7 @@ public class ReportJob { } } - public String parsePacsGetBase64(String xml) { + public String parsePacsGetBase64(String xml) { try { XmlUtil xmlUtil = XmlUtil.of(xml); Node codeNode = xmlUtil.getNode("/Result/Code");