超声接口优化

This commit is contained in:
Flow 2025-06-27 10:16:08 +08:00
parent 133d07043d
commit b88bb7296f
3 changed files with 18 additions and 4 deletions

View File

@ -988,15 +988,15 @@ public class InspectPatientController {
@GetMapping("/getUSTj")
@Operation(summary = "获取超声报告")
public CommonResult<Boolean> GetApiPacsInfo(@RequestParam("medicalSn") String medicalSn) {
// 获取患者信息
InspectPatientDO patientDO = patientService.getPatientInfo(medicalSn);
if (patientDO == null) {
// 只获取shortid字段提高查询性能
String shortid = patientService.getPatientShortid(medicalSn);
if (shortid == null) {
return success(false);
}
ConfigDO config = configService.getConfigByKey("url.ustj");
String url = config.getValue();
String response = HttpUtils.get(url + "?" + "examid=" + medicalSn + "&" + "orgSN=" + patientDO.getShortid());
String response = HttpUtils.get(url + "?" + "examid=" + medicalSn + "&" + "orgSN=" + shortid);
if (response != null) {
// 解析 JSON 响应
ObjectMapper objectMapper = new ObjectMapper();

View File

@ -82,6 +82,11 @@ public interface InspectPatientService {
* 根据体检编号获取患者信息的json
* */
InspectPatientDO getPatientInfo(String medicalSn);
/*
* 根据体检编号只获取shortid字段
* */
String getPatientShortid(String medicalSn);
/*
* 更新患者的基本信息里的补充信息 高血压老年人行政村卫生院糖尿病精神病
* */

View File

@ -172,6 +172,15 @@ public class InspectPatientServiceImpl implements InspectPatientService {
return patientDO;
}
@Override
public String getPatientShortid(String medicalSn) {
LambdaQueryWrapper<InspectPatientDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(InspectPatientDO::getMedicalSn, medicalSn)
.select(InspectPatientDO::getShortid);
InspectPatientDO patientDO = patientMapper.selectOne(queryWrapper);
return patientDO != null ? patientDO.getShortid() : null;
}
@Override
public List<InspectPatientDO> getPatientdetails(PatientDetailsVO detailsVO) {
LambdaQueryWrapper<InspectPatientDO> queryWrapper = new LambdaQueryWrapper<>();