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 2bc21a4..c8f5b3f 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 @@ -398,7 +398,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) {