修改BUG

This commit is contained in:
lxd 2025-03-31 18:10:52 +08:00
parent cad5193cbd
commit b97c7ce7df
3 changed files with 66 additions and 2 deletions

View File

@ -472,6 +472,7 @@ public class InspectPatientController {
//获取患者信息
InspectPatientDO patientDO = patientService.getPatientInfo(medicalSn);
if (patientDO != null) {
String model = "";
String barCode = "";
switch (type) {
@ -497,13 +498,63 @@ public class InspectPatientController {
}
break;
}
ConfigDO config = configService.getConfigByKey("url.reporttj");
String url = config.getValue();
//查询是否已经存在记录 存在则不进行同步操作
if(pacsDataService.IspacsDataExist(medicalSn, model))
{
if(!pacsDataService.IspacsDataitemExist(medicalSn, model))
{
//没有对应的item值 更新
String response = HttpUtils.get(url + "?" + "barCode=" + barCode + "&" + "hospitalCode=" + patientDO.getHospitalNo());
if (response != null)
{
// 解析 JSON 响应
ObjectMapper objectMapper = new ObjectMapper();
try {
ReportResponse reportResponse = objectMapper.readValue(response, ReportResponse.class);
if ("操作成功".equals(reportResponse.getMsg()) && reportResponse.getCode() == 200)
{
ReportData reportData = reportResponse.getData();
// 获取 reportPath
String reportPath = reportData.getReportPath();
if(!reportPath.contains("报告暂未出"))
{
StringBuilder sb = new StringBuilder();
InspectPacsDataSaveReqVO inspectPacs = new InspectPacsDataSaveReqVO();
inspectPacs.setCode(patientDO.getMedicalSn());
inspectPacs.setType(model);
if(reportData.getResults()!=null&&reportData.getResults().size()>0)
{
// 获取 results 数组并遍历
List<ResultItem> results = reportData.getResults();
for (ResultItem result : results) {
// 判断 Item Tips 并输出相应的结果
String itemTips = result.getItemTips();
String tipsDescription = "";
if ("1".equals(itemTips)) {
tipsDescription = "偏低";
} else if ("4".equals(itemTips)) {
tipsDescription = "偏高";
}
sb.append(""+result.getItemName() +""+tipsDescription+" ,结果:" + result.getItemValue() + result.getItemUnit() +","+"参考值("+result.getReferenceRange()+ ")】"+"\n");
}
inspectPacs.setItem(sb.toString());
}
pacsDataService.updatePacsDataitem(inspectPacs);
}
}
} catch (IOException e) {
e.printStackTrace();
return success(true);
}
}
}
return success(true);
}
ConfigDO config = configService.getConfigByKey("url.reporttj");
String url = config.getValue();
String response = HttpUtils.get(url + "?" + "barCode=" + barCode + "&" + "hospitalCode=" + patientDO.getHospitalNo());
if (response != null) {
// 解析 JSON 响应

View File

@ -62,6 +62,11 @@ public interface InspectPacsDataService {
* 根据体检编号和类型判断是否存在pacs数据
* */
Boolean IspacsDataExist(String code, String type);
/*
*
* 根据体检编号和类型判断是否存在pacs的item数据
* */
Boolean IspacsDataitemExist(String code, String type);
/**
* 获得pacs抓取数据分页

View File

@ -97,6 +97,14 @@ public class InspectPacsDataServiceImpl implements InspectPacsDataService {
return pacsDataMapper.selectList(queryWrapper).size()>0? true:false;
}
@Override
public Boolean IspacsDataitemExist(String code, String type) {
QueryWrapper<InspectPacsDataDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("code", code)
.eq("type", type)
.isNotNull("item");
return pacsDataMapper.selectCount(queryWrapper) > 0;
}
@Override
public PageResult<InspectPacsDataDO> getPacsDataPage(InspectPacsDataPageReqVO pageReqVO) {
return pacsDataMapper.selectPage(pageReqVO);