新增获取体检超声报告接口

This commit is contained in:
lxd 2025-03-13 10:33:36 +08:00
parent 910c201f0f
commit 29acd760a5

View File

@ -394,7 +394,39 @@ public class InspectPatientController {
}
return success(true);
}
@GetMapping("/getUSTj")
@Operation(summary = "获取超声报告")
public CommonResult<Boolean> 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<String, Object> responseMap = objectMapper.readValue(response, Map.class);
Map<String, Object> dataMap = (Map<String, Object>) 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<Boolean> updatePatient(@Valid @RequestBody InspectPatientSaveReqVO updateReqVO) {