From ea7719cb6cc3eacb51a1c9ef2fdd618883ca817f Mon Sep 17 00:00:00 2001 From: wyb <1977763549@qq.com> Date: Thu, 27 Mar 2025 12:07:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A2=85=E5=B7=9E=E4=B8=AD=E5=8C=BB?= =?UTF-8?q?=E9=99=A2=E6=89=8B=E9=BA=BB=E6=8A=A5=E5=91=8A=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-config/mzzyy-assort-config | 55 +++++++ data-config/mzzyy-ws-config | 25 ++-- .../config/StaticResourceWebConfig.java | 2 + .../mzzyy/controller/MzZyyApiController.java | 35 +++++ .../mzzyy/job/MzZyyReportCollectJob.java | 138 +++++++++++++++++- .../docus/server/rpc/MzZyyShouMaService.java | 27 ++++ ...ShouMaMedicalDocumentFileForBase64Dto.java | 27 ++++ .../MzZyyShouMaMedicalDocumentInfoDto.java | 52 +++++++ ...zZyyShouMaQueryMedicalDocumentInfoDto.java | 23 +++ .../rpc/impl/MzZyyShouMaServiceImpl.java | 45 ++++++ .../server/util/StaticResourceMapping.java | 6 + 11 files changed, 422 insertions(+), 13 deletions(-) create mode 100644 data-config/mzzyy-assort-config create mode 100644 src/main/java/com/docus/server/rpc/MzZyyShouMaService.java create mode 100644 src/main/java/com/docus/server/rpc/dto/MzZyyShouMaMedicalDocumentFileForBase64Dto.java create mode 100644 src/main/java/com/docus/server/rpc/dto/MzZyyShouMaMedicalDocumentInfoDto.java create mode 100644 src/main/java/com/docus/server/rpc/dto/MzZyyShouMaQueryMedicalDocumentInfoDto.java create mode 100644 src/main/java/com/docus/server/rpc/impl/MzZyyShouMaServiceImpl.java diff --git a/data-config/mzzyy-assort-config b/data-config/mzzyy-assort-config new file mode 100644 index 0000000..9120d29 --- /dev/null +++ b/data-config/mzzyy-assort-config @@ -0,0 +1,55 @@ +{ + "shouMa": { + "notCollect": [ + "手术登记", + "手术费用明细", + "处方单", + "医用材料登记", + "一次性医用耗材标签粘贴单", + "仪器设备使用登记" + ], + "defaultAssort":"DB5E7DA78A7E480991D65B8C2A8E2850", + "assort": [ + { + "title": "麻醉记录", + "assortId": "DB5E7DA78A7E480991D65B8C2A8E2848" + }, + { + "title": "手术安全核查", + "assortId": "15E7FE7803F545CB81390BC88E725240" + }, + { + "title": "手术风险评估", + "assortId": "15E7FE7803F545CB81390BC88E725240" + }, + { + "title": "麻醉恢复室记录单", + "assortId": "EABEEB5D628449A7930F4C0A9953A754" + }, + { + "title": "PACU|麻醉恢复室记录单", + "assortId": "EABEEB5D628449A7930F4C0A9953A754" + }, + { + "title": "三方核查(介入使用)|手术安全核查表", + "assortId": "EABEEB5D628449A7930F4C0A9953A754" + }, + { + "title": "压疮风险评估表|手术风险评估表", + "assortId": "EABEEB5D628449A7930F4C0A9953A754" + }, + { + "title": "麻醉知情同意|麻醉同意书", + "assortId": "EABEEB5D628449A7930F4C0A9953A754" + }, + { + "title": "器械清点|器材清点|器械、敷料核对表", + "assortId": "EABEEB5D628449A7930F4C0A9953A754" + }, + { + "title": "无痛舒适|无痛舒适检查麻醉同意书", + "assortId": "EABEEB5D628449A7930F4C0A9953A754" + } + ] + } +} \ No newline at end of file diff --git a/data-config/mzzyy-ws-config b/data-config/mzzyy-ws-config index 4086700..06fd02c 100644 --- a/data-config/mzzyy-ws-config +++ b/data-config/mzzyy-ws-config @@ -1,11 +1,18 @@ { - "lis":{ - "collectorId":"1", - "assortId":"lis", - "url": "http://199.168.91.176:9001/NeuLisExportPDFService.asmx?wsdl", - "namespaceUri": "", - "pdfListOperationName": "GetTestFormPDF", - "RTBase64OperationName": "ExportTestFormPDF_GMForNoPaper", - "GMBase64OperationName": "ExportTestFormPDF_GMForNoPaper" - } + "lis": { + "collectorId": "1", + "assortId": "lis", + "url": "http://199.168.91.176:9001/NeuLisExportPDFService.asmx?wsdl", + "namespaceUri": "", + "pdfListOperationName": "GetTestFormPDF", + "RTBase64OperationName": "ExportTestFormPDF_GMForNoPaper", + "GMBase64OperationName": "ExportTestFormPDF_GMForNoPaper" + }, + "shouMa": { + "collectorId": "shouma", + "hospCode": "#hospital", + "branchCode": "#branch", + "documentInfoListUrl": "http://199.168.91.78:80/odbip/api/outer/medicalDocument/queryMedicalDocumentInfoList", + "documentFileForBase64Url": "http://199.168.91.78:80/odbip/api/outer/medicalDocument/getMedicalDocumentFileForBase64" + } } \ No newline at end of file diff --git a/src/main/java/com/docus/server/config/StaticResourceWebConfig.java b/src/main/java/com/docus/server/config/StaticResourceWebConfig.java index e747dfc..2343e3c 100644 --- a/src/main/java/com/docus/server/config/StaticResourceWebConfig.java +++ b/src/main/java/com/docus/server/config/StaticResourceWebConfig.java @@ -21,6 +21,8 @@ public class StaticResourceWebConfig implements WebMvcConfigurer { // 静态资源映射 registry.addResourceHandler("/"+ StaticResourceMapping.LIS +"/**") .addResourceLocations("file:"+ TableJsonRead.currentPath(StaticResourceMapping.STATIC_RESOURCE_PREFIX+ File.separator+StaticResourceMapping.LIS)+File.separator); + registry.addResourceHandler("/"+ StaticResourceMapping.SHOU_MA +"/**") + .addResourceLocations("file:"+ TableJsonRead.currentPath(StaticResourceMapping.STATIC_RESOURCE_PREFIX+ File.separator+StaticResourceMapping.SHOU_MA)+File.separator); } } diff --git a/src/main/java/com/docus/server/mzzyy/controller/MzZyyApiController.java b/src/main/java/com/docus/server/mzzyy/controller/MzZyyApiController.java index 59b8f72..03d78fe 100644 --- a/src/main/java/com/docus/server/mzzyy/controller/MzZyyApiController.java +++ b/src/main/java/com/docus/server/mzzyy/controller/MzZyyApiController.java @@ -3,7 +3,11 @@ package com.docus.server.mzzyy.controller; import com.docus.infrastructure.web.api.CommonResult; import com.docus.server.rpc.MzZyyLisService; +import com.docus.server.rpc.MzZyyShouMaService; import com.docus.server.rpc.dto.MzZyyLisExportDto; +import com.docus.server.rpc.dto.MzZyyShouMaMedicalDocumentFileForBase64Dto; +import com.docus.server.rpc.dto.MzZyyShouMaMedicalDocumentInfoDto; +import com.docus.server.rpc.dto.MzZyyShouMaQueryMedicalDocumentInfoDto; import com.docus.server.rpc.dto.MzZyyTestDto; import com.docus.server.rpc.enums.MzZyyLisType; import io.swagger.annotations.Api; @@ -25,6 +29,9 @@ import java.util.List; public class MzZyyApiController { @Autowired private MzZyyLisService mzZyyLisService; + @Autowired + private MzZyyShouMaService mzZyyShouMaService; + /** * 测试 @@ -52,6 +59,34 @@ public class MzZyyApiController { return CommonResult.success(files); } + + /** + * 测试 + */ + @GetMapping("/shouma/getMedicalDocumentFileForBase64Test") + @ApiOperation("手麻文书base64获取测试") + public CommonResult getMedicalDocumentFileForBase64Test(@RequestParam(name = "reportNo") String reportNo) { + MzZyyShouMaMedicalDocumentFileForBase64Dto fileForBase64 = mzZyyShouMaService.getMedicalDocumentFileForBase64(reportNo); + return CommonResult.success(fileForBase64); + } + + /** + * 测试 + */ + @GetMapping("/shouma/queryMedicalDocumentInfoListTest") + @ApiOperation("手麻文书信息列表获取测试") + public CommonResult queryMedicalDocumentInfoListTest(@RequestParam(name = "jzh") String jzh, + @RequestParam(name = "hospCode") String hospCode, + @RequestParam(name = "branchCode") String branchCode) { + MzZyyShouMaQueryMedicalDocumentInfoDto mzZyyShouMaQueryMedicalDocumentInfoDto = new MzZyyShouMaQueryMedicalDocumentInfoDto(); + mzZyyShouMaQueryMedicalDocumentInfoDto.setHospCode(hospCode); + mzZyyShouMaQueryMedicalDocumentInfoDto.setBranchCode(branchCode); + mzZyyShouMaQueryMedicalDocumentInfoDto.setInPatientSeqNo(jzh); + MzZyyShouMaMedicalDocumentInfoDto mzZyyShouMaMedicalDocumentInfoDto = mzZyyShouMaService.queryMedicalDocumentInfoList(mzZyyShouMaQueryMedicalDocumentInfoDto); + return CommonResult.success(mzZyyShouMaMedicalDocumentInfoDto); + } + + public static void main(String[] args) { System.out.println(new MzZyyLisExportDto()); } diff --git a/src/main/java/com/docus/server/mzzyy/job/MzZyyReportCollectJob.java b/src/main/java/com/docus/server/mzzyy/job/MzZyyReportCollectJob.java index 2e47322..72e91f7 100644 --- a/src/main/java/com/docus/server/mzzyy/job/MzZyyReportCollectJob.java +++ b/src/main/java/com/docus/server/mzzyy/job/MzZyyReportCollectJob.java @@ -1,6 +1,7 @@ package com.docus.server.mzzyy.job; import cn.hutool.core.io.FileUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.docus.core.util.Func; import com.docus.infrastructure.web.api.CommonResult; @@ -8,8 +9,12 @@ import com.docus.infrastructure.web.api.ResultCode; import com.docus.server.archive.mapper.TBasicMapper; import com.docus.server.rpc.DownPlatformService; import com.docus.server.rpc.MzZyyLisService; +import com.docus.server.rpc.MzZyyShouMaService; import com.docus.server.rpc.TaskDistributeService; import com.docus.server.rpc.dto.MzZyyLisExportDto; +import com.docus.server.rpc.dto.MzZyyShouMaMedicalDocumentFileForBase64Dto; +import com.docus.server.rpc.dto.MzZyyShouMaMedicalDocumentInfoDto; +import com.docus.server.rpc.dto.MzZyyShouMaQueryMedicalDocumentInfoDto; import com.docus.server.rpc.dto.MzZyyTestDto; import com.docus.server.rpc.dto.ReportDownDto; import com.docus.server.rpc.dto.ReportDownPatientDto; @@ -33,6 +38,7 @@ import java.util.Collections; import java.util.Date; import java.util.List; import java.util.Locale; +import java.util.Objects; /** * @author YongBin Wen @@ -48,6 +54,8 @@ public class MzZyyReportCollectJob { @Autowired private MzZyyLisService mzZyyLisService; @Autowired + private MzZyyShouMaService mzZyyShouMaService; + @Autowired private TBasicMapper tBasicMapper; @XxlJob("MzZyyLisCollectJob") @@ -126,7 +134,7 @@ public class MzZyyReportCollectJob { List scanFiles = Collections.singletonList(reportDownScanFileDto); reportDownDto.setAssortid(assortId); reportDownDto.setScanfiles(scanFiles); - tBasicMapper.invalidFileBySource(patientId,collectorId); + tBasicMapper.invalidFileBySource(patientId, collectorId); downPlatformService.report(reportDownDto); } @@ -136,15 +144,137 @@ public class MzZyyReportCollectJob { String configName = "mzzyy-ws-config"; TableJsonRead jsonReader = new TableJsonRead(); JSONObject configOjb = jsonReader.Read(configPath, configName, JSONObject.class); - JSONObject lisWsConfig = configOjb.getJSONObject("shouMa"); - String collectorId = lisWsConfig.getString("collectorId"); - String assortId = lisWsConfig.getString("assortId"); + JSONObject shouMaConfig = configOjb.getJSONObject("shouMa"); + String collectorId = shouMaConfig.getString("collectorId"); + String hospCode = shouMaConfig.getString("hospCode"); + String branchCode = shouMaConfig.getString("branchCode"); + CommonResult commonResult = taskDistributeService.getNoViewTaskByCollectorId(collectorId); if (!ResultCode.SUCCESS.getCode().equals(commonResult.getCode()) || commonResult.getData() == null) { return; } + ReportDownTwoDto downTwoDto = commonResult.getData(); + ReportTaskTwoDto task = downTwoDto.getTasks().get(0); + log.info(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院手麻采集任务,获取了任务:{}", Func.toJson(task)); + ReportPatientTwoDto reportPatientTwoDto = downTwoDto.getPatient(); + String jzh = downTwoDto.getJzh(); + String patientId = downTwoDto.getPatientId(); + String inpatientNo = reportPatientTwoDto.getInpatientNo(); + + String formatDate = Func.formatDate(new Date()); + String fileDirPath = TableJsonRead.currentPath(StaticResourceMapping.STATIC_RESOURCE_PREFIX + File.separator + StaticResourceMapping.SHOU_MA) + + File.separator + formatDate + + File.separator + patientId; + MzZyyShouMaQueryMedicalDocumentInfoDto queryMedicalDocumentInfoDto = new MzZyyShouMaQueryMedicalDocumentInfoDto(); + queryMedicalDocumentInfoDto.setHospCode(hospCode); + queryMedicalDocumentInfoDto.setBranchCode(branchCode); + queryMedicalDocumentInfoDto.setInPatientSeqNo(jzh); + MzZyyShouMaMedicalDocumentInfoDto queryMedicalDocumentInfoList = mzZyyShouMaService.queryMedicalDocumentInfoList(queryMedicalDocumentInfoDto); + // 查询文书列表,为空|状态不为ok|数据为空 结束 + if (Objects.isNull(queryMedicalDocumentInfoList) || + !"ok".equals(queryMedicalDocumentInfoList.getStatus()) || + Func.isEmpty(queryMedicalDocumentInfoList.getData())) { + if (!Objects.isNull(queryMedicalDocumentInfoList)) { + log.info("住院号:{},住院流水号:{},查询手麻医疗文书列表为空,返回信息为:{}。", inpatientNo, jzh, Func.toJson(queryMedicalDocumentInfoList)); + } + return; + } + List scanFiles = new ArrayList<>(); + + List documentInfoListData = queryMedicalDocumentInfoList.getData(); + for (MzZyyShouMaMedicalDocumentInfoDto.Data documentInfoListDatum : documentInfoListData) { + String reportId = documentInfoListDatum.getReportId(); + String reportTypeName = documentInfoListDatum.getReportTypeName(); + MzZyyShouMaMedicalDocumentFileForBase64Dto medicalDocumentFileForBase64 = mzZyyShouMaService.getMedicalDocumentFileForBase64(reportId); + if (Objects.isNull(medicalDocumentFileForBase64) || + !"ok".equals(medicalDocumentFileForBase64.getStatus()) || + Objects.isNull(medicalDocumentFileForBase64.getData())) { + if (!Objects.isNull(medicalDocumentFileForBase64)) { + log.info("手麻医疗文书,reportId:{} 获取pdf为空,返回信息为:{}。", reportId, Func.toJson(medicalDocumentFileForBase64)); + } + continue; + } + MzZyyShouMaMedicalDocumentFileForBase64Dto.Data base64Data = medicalDocumentFileForBase64.getData(); + String fileBase64 = base64Data.getFileBase64(); + String fileType = base64Data.getFileType(); + String filePath = fileDirPath + File.separator + reportId + "." + fileType.toLowerCase(Locale.ROOT); + String httpUrl = "http://127.0.0.1:9010/shouma/" + formatDate + "/" + patientId + "/" + reportId + "." + fileType.toLowerCase(Locale.ROOT); + byte[] decode = Base64.getDecoder().decode(fileBase64); + FileUtil.writeBytes(decode, filePath); + + ReportDownScanFileDto scanFileDto = new ReportDownScanFileDto(); + scanFileDto.setFiletype(1); + scanFileDto.setDownurl(httpUrl); + scanFileDto.setFiletitle(reportTypeName); + scanFileDto.setSerialnum(reportId); + scanFileDto.setFilesource(1); + scanFileDto.setFilestoragetype(1); + scanFileDto.setTaskid(task.getTaskId()); + scanFiles.add(scanFileDto); + } + + if (Func.isNotEmpty(scanFiles)) { + ReportDownPatientDto patient = new ReportDownPatientDto(); + patient.setPatientid(patientId); + + ReportDownDto reportDownDto = new ReportDownDto(); + reportDownDto.setCollectorid(collectorId); + reportDownDto.setIp("java-shouma-job"); + reportDownDto.setPatient(patient); + tBasicMapper.invalidFileBySource(patientId, collectorId); + for (ReportDownScanFileDto scanFile : scanFiles) { + List scanFileDtos = Collections.singletonList(scanFile); + String assortId = getShouMaAssortId(scanFile.getFiletitle()); + if (Objects.isNull(assortId)) { + continue; + } + reportDownDto.setAssortid(assortId); + reportDownDto.setScanfiles(scanFileDtos); + downPlatformService.report(reportDownDto); + } + } + } + + /** + * 根据手麻的文件类型,得到归档的文件分段,有些文件不需要采集,则返回空 + * + * @param fileTitle 文件类型标题 + * @return 归档的文件分段 + */ + private String getShouMaAssortId(String fileTitle) { + String configPath = "data-config"; + String configName = "mzzyy-assort-config"; + TableJsonRead jsonReader = new TableJsonRead(); + JSONObject configOjb = jsonReader.Read(configPath, configName, JSONObject.class); + JSONObject shouMa = configOjb.getJSONObject("shouMa"); + String defaultAssort = shouMa.getString("defaultAssort"); + JSONArray notCollect = shouMa.getJSONArray("notCollect"); + List notCollectTitles = notCollect.toJavaList(String.class); + JSONArray assort = shouMa.getJSONArray("assort"); + List assortConfigs = assort.toJavaList(JSONObject.class); + + for (String notCollectTitle : notCollectTitles) { + if (fileTitle.contains(notCollectTitle)) { + return null; + } + } + for (JSONObject assortConfig : assortConfigs) { + String title = assortConfig.getString("title"); + String assortId = assortConfig.getString("assortId"); + String[] titles = title.split("\\|"); + for (String t : titles) { + if (fileTitle.toLowerCase(Locale.ROOT).contains(t.toLowerCase(Locale.ROOT))) { + return assortId; + } + } + } + return defaultAssort; + } + + public static void main(String[] args) { + System.out.println(new MzZyyReportCollectJob().getShouMaAssortId("手术登记")); } } diff --git a/src/main/java/com/docus/server/rpc/MzZyyShouMaService.java b/src/main/java/com/docus/server/rpc/MzZyyShouMaService.java new file mode 100644 index 0000000..6ef68d8 --- /dev/null +++ b/src/main/java/com/docus/server/rpc/MzZyyShouMaService.java @@ -0,0 +1,27 @@ +package com.docus.server.rpc; + +import com.docus.server.rpc.dto.MzZyyShouMaMedicalDocumentFileForBase64Dto; +import com.docus.server.rpc.dto.MzZyyShouMaMedicalDocumentInfoDto; +import com.docus.server.rpc.dto.MzZyyShouMaQueryMedicalDocumentInfoDto; + +/** + * @author YongBin Wen + * @date 2025/3/18 9:27 + */ +public interface MzZyyShouMaService { + /** + * 查询医疗文书列表信息 + * + * @param dto 参数 + * @return 结果 + */ + MzZyyShouMaMedicalDocumentInfoDto queryMedicalDocumentInfoList(MzZyyShouMaQueryMedicalDocumentInfoDto dto); + + /** + * 查询医疗文书PDF信息 + * + * @param reportNo 对应查《询医疗文书列表信息》接口中reportId + * @return 文件信息base64 + */ + MzZyyShouMaMedicalDocumentFileForBase64Dto getMedicalDocumentFileForBase64(String reportNo); +} diff --git a/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaMedicalDocumentFileForBase64Dto.java b/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaMedicalDocumentFileForBase64Dto.java new file mode 100644 index 0000000..f1d55af --- /dev/null +++ b/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaMedicalDocumentFileForBase64Dto.java @@ -0,0 +1,27 @@ +package com.docus.server.rpc.dto; + +import lombok.Data; + +/** + * @author YongBin Wen + * @date 2025/3/27 10:19 + */ +@Data +public class MzZyyShouMaMedicalDocumentFileForBase64Dto { + /** + * 正常的状态 ok,错误的状态 ng + */ + private String status; + private String code; + private String message; + private Data data; + @lombok.Data + public static class Data{ + private String fileBase64; + /** + * + * PDF:表示pdf文件,目前手麻类型只有“PDF” + */ + private String fileType; + } +} diff --git a/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaMedicalDocumentInfoDto.java b/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaMedicalDocumentInfoDto.java new file mode 100644 index 0000000..8e4f2b5 --- /dev/null +++ b/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaMedicalDocumentInfoDto.java @@ -0,0 +1,52 @@ +package com.docus.server.rpc.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author YongBin Wen + * @date 2025/3/27 10:04 + */ +@Data +public class MzZyyShouMaMedicalDocumentInfoDto { + /** + * 正常的状态 ok,错误的状态 ng + */ + private String status; + private String code; + private String message; + private List data; + + @lombok.Data + public static class Data { + /** + * 报告唯一编码 + */ + private String reportId; + /** + * 医院编码 + */ + private String hospCode; + /** + * 院区编码 + */ + private String branchCode; + /** + * 报告类型名称 + */ + private String reportTypeName; + /** + * 报告类型编码 + */ + private String reportTypeCode; + /** + * 归档时间 yyyy-MM-dd HH:mm:ss + */ + private String archiveTime; + /** + * PDF url地址 此地址需要手麻工程师配置服务访问地址前缀“http://ip:port/odbip”,如果没配置,看到的地址为不带前缀的内部服务地址,需要联系手麻工程师调整配置,以免影响正常访问。 + */ + private String pdfUrl; + } +} diff --git a/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaQueryMedicalDocumentInfoDto.java b/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaQueryMedicalDocumentInfoDto.java new file mode 100644 index 0000000..7d7f56b --- /dev/null +++ b/src/main/java/com/docus/server/rpc/dto/MzZyyShouMaQueryMedicalDocumentInfoDto.java @@ -0,0 +1,23 @@ +package com.docus.server.rpc.dto; + +import lombok.Data; + +/** + * @author YongBin Wen + * @date 2025/3/27 10:04 + */ +@Data +public class MzZyyShouMaQueryMedicalDocumentInfoDto { + /** + * 医院编码 + */ + private String hospCode; + /** + * 院区编码 + */ + private String branchCode; + /** + * 住院流水号,归档jzh + */ + private String inPatientSeqNo; +} diff --git a/src/main/java/com/docus/server/rpc/impl/MzZyyShouMaServiceImpl.java b/src/main/java/com/docus/server/rpc/impl/MzZyyShouMaServiceImpl.java new file mode 100644 index 0000000..3af2712 --- /dev/null +++ b/src/main/java/com/docus/server/rpc/impl/MzZyyShouMaServiceImpl.java @@ -0,0 +1,45 @@ +package com.docus.server.rpc.impl; + +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.docus.server.rpc.MzZyyShouMaService; +import com.docus.server.rpc.dto.MzZyyShouMaMedicalDocumentFileForBase64Dto; +import com.docus.server.rpc.dto.MzZyyShouMaMedicalDocumentInfoDto; +import com.docus.server.rpc.dto.MzZyyShouMaQueryMedicalDocumentInfoDto; +import com.docus.server.util.TableJsonRead; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author YongBin Wen + * @date 2025/3/18 9:27 + */ +@Service +@Slf4j +public class MzZyyShouMaServiceImpl implements MzZyyShouMaService { + final String configPath = "data-config"; + final String configName = "mzzyy-ws-config"; + + @Override + public MzZyyShouMaMedicalDocumentInfoDto queryMedicalDocumentInfoList(MzZyyShouMaQueryMedicalDocumentInfoDto dto) { + TableJsonRead jsonReader = new TableJsonRead(); + JSONObject configOjb = jsonReader.Read(configPath, configName, JSONObject.class); + JSONObject shouMaConfig = configOjb.getJSONObject("shouMa"); + String documentInfoListUrl = shouMaConfig.getString("documentInfoListUrl"); + String bodyString = JSON.toJSONString(dto); + String resp = HttpUtil.post(documentInfoListUrl, bodyString); + return JSON.parseObject(resp, MzZyyShouMaMedicalDocumentInfoDto.class); + } + + @Override + public MzZyyShouMaMedicalDocumentFileForBase64Dto getMedicalDocumentFileForBase64(String reportNo) { + TableJsonRead jsonReader = new TableJsonRead(); + JSONObject configOjb = jsonReader.Read(configPath, configName, JSONObject.class); + JSONObject shouMaConfig = configOjb.getJSONObject("shouMa"); + String documentFileForBase64Url = shouMaConfig.getString("documentFileForBase64Url"); + String urlString = documentFileForBase64Url + "?reportNo=" + reportNo; + String resp = HttpUtil.get(urlString); + return JSON.parseObject(resp, MzZyyShouMaMedicalDocumentFileForBase64Dto.class); + } +} diff --git a/src/main/java/com/docus/server/util/StaticResourceMapping.java b/src/main/java/com/docus/server/util/StaticResourceMapping.java index 91203e7..bbf2e40 100644 --- a/src/main/java/com/docus/server/util/StaticResourceMapping.java +++ b/src/main/java/com/docus/server/util/StaticResourceMapping.java @@ -17,5 +17,11 @@ public interface StaticResourceMapping { */ String LIS= "lis"; + /** + * 手麻报告存放地址 + */ + String SHOU_MA= "shouma"; + + }