修改同步检验报告方法
This commit is contained in:
parent
84daa7d10a
commit
ceceac4c07
@ -450,17 +450,39 @@ public class InspectPatientController {
|
||||
// 解析 JSON 响应
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
Map<String, Object> responseMap = objectMapper.readValue(response, Map.class);
|
||||
String msg = (String) responseMap.get("msg");
|
||||
if (!msg.contains("报告暂未出")) {
|
||||
InspectPacsDataSaveReqVO inspectPacs = new InspectPacsDataSaveReqVO();
|
||||
inspectPacs.setCode(patientDO.getMedicalSn());
|
||||
inspectPacs.setData(msg);
|
||||
inspectPacs.setType(model);
|
||||
inspectPacs.setPersonName(patientDO.getPName());
|
||||
pacsDataService.createPacsData(inspectPacs);
|
||||
}
|
||||
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.setData(reportPath);
|
||||
inspectPacs.setType(model);
|
||||
inspectPacs.setPersonName(patientDO.getPName());
|
||||
// 获取 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() + ":" + result.getItemValue() + result.getItemUnit() + ","+"正常范围:"+result.getReferenceRange()+","+"提示:"+tipsDescription+"。"+"\n");
|
||||
}
|
||||
inspectPacs.setItem(sb.toString());
|
||||
pacsDataService.createPacsData(inspectPacs);
|
||||
}
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return success(true);
|
||||
|
Loading…
Reference in New Issue
Block a user