修改同步检验报告方法
This commit is contained in:
parent
84daa7d10a
commit
ceceac4c07
@ -450,17 +450,39 @@ public class InspectPatientController {
|
|||||||
// 解析 JSON 响应
|
// 解析 JSON 响应
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
try {
|
try {
|
||||||
Map<String, Object> responseMap = objectMapper.readValue(response, Map.class);
|
ReportResponse reportResponse = objectMapper.readValue(response, ReportResponse.class);
|
||||||
String msg = (String) responseMap.get("msg");
|
if ("操作成功".equals(reportResponse.getMsg()) && reportResponse.getCode() == 200)
|
||||||
if (!msg.contains("报告暂未出")) {
|
{
|
||||||
|
ReportData reportData = reportResponse.getData();
|
||||||
|
// 获取 reportPath
|
||||||
|
String reportPath = reportData.getReportPath();
|
||||||
|
if(!reportPath.contains("报告暂未出"))
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
InspectPacsDataSaveReqVO inspectPacs = new InspectPacsDataSaveReqVO();
|
InspectPacsDataSaveReqVO inspectPacs = new InspectPacsDataSaveReqVO();
|
||||||
inspectPacs.setCode(patientDO.getMedicalSn());
|
inspectPacs.setCode(patientDO.getMedicalSn());
|
||||||
inspectPacs.setData(msg);
|
inspectPacs.setData(reportPath);
|
||||||
inspectPacs.setType(model);
|
inspectPacs.setType(model);
|
||||||
inspectPacs.setPersonName(patientDO.getPName());
|
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);
|
pacsDataService.createPacsData(inspectPacs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return success(true);
|
return success(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user