From 29acd760a58830ecdf0660507025b4c92996a2a9 Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Thu, 13 Mar 2025 10:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E4=BD=93?= =?UTF-8?q?=E6=A3=80=E8=B6=85=E5=A3=B0=E6=8A=A5=E5=91=8A=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InspectPatientController.java | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java index 255fb4f..9b7a75e 100644 --- a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java +++ b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java @@ -394,7 +394,39 @@ public class InspectPatientController { } return success(true); } - + @GetMapping("/getUSTj") + @Operation(summary = "获取超声报告") + public CommonResult GetApiPacsInfo(@RequestParam("medicalSn") String medicalSn) + { + ConfigDO config = configService.getConfigByKey("url.ustj"); + String url = config.getValue(); + String response = HttpUtils.get(url+"?"+"examid="+medicalSn+"&"+"orgSN="+"1001"); + if(response!=null) + { + // 解析 JSON 响应 + ObjectMapper objectMapper = new ObjectMapper(); + try { + Map responseMap = objectMapper.readValue(response, Map.class); + Map dataMap = (Map) responseMap.get("data"); + // 获取 pdfurl 和 pname + String pdfurl = (String) dataMap.get("pdfurl"); + String pname = (String) dataMap.get("pname"); + // 检查 pdfurl 和 pname 是否为空 + if (pdfurl != null && !pdfurl.isEmpty() && pname != null && !pname.isEmpty()) { + InspectPacsDataSaveReqVO inspectPacs = new InspectPacsDataSaveReqVO(); + inspectPacs.setCode(medicalSn); + inspectPacs.setData(pdfurl); + inspectPacs.setType("US"); + inspectPacs.setPersonName(pname); + pacsDataService.createPacsData(inspectPacs); + } + } catch (IOException e) { + e.printStackTrace(); + return success(false); + } + } + return success(true); + } @PutMapping("/update") @Operation(summary = "更新患者信息") public CommonResult updatePatient(@Valid @RequestBody InspectPatientSaveReqVO updateReqVO) {