web : 1. 查询体格检查的结果接口,如果未查询到检查部位,提供空数据

release_1.0.0
xueqingkun 1 year ago
parent 06e8f8ee31
commit de095723b1

@ -57,14 +57,18 @@ public class AskPhysicalServiceImpl implements AskPhysicalService {
ConfigPhysicalTool tool = Optional.ofNullable(toolService.getById(reqVO.getToolId())).orElseThrow(() -> new BusinessException("工具不支持"));
// 是否需要具体的部位,0否1是
ConfigPhysicalLocation location = new ConfigPhysicalLocation();
if (1 == tool.getRequireLocation()) {
if (StrUtil.isBlank(reqVO.getLocationCode())){
DiseasePhysical result = new DiseasePhysical();
if (1 == tool.getRequireLocation() && StrUtil.isBlank(reqVO.getLocationCode())) {
throw new BusinessException("请选择对应的位置");
}
if (1 == tool.getRequireLocation()) {
location = locationService.lambdaQuery().eq(ConfigPhysicalLocation::getCode, reqVO.getLocationCode()).last("limit 1")
.oneOpt().orElseGet(ConfigPhysicalLocation::new);
}
DiseasePhysical result = diseasePhysicalService.lambdaQuery().eq(DiseasePhysical::getMedicalRecId, process.getMedicalRecId())
if (1 == tool.getRequireLocation() && StrUtil.isEmpty(location.getId())) {
result.setResult("无相关资讯");
} else {
result = diseasePhysicalService.lambdaQuery().eq(DiseasePhysical::getMedicalRecId, process.getMedicalRecId())
.eq(DiseasePhysical::getToolId, tool.getId()).eq(StrUtil.isNotBlank(location.getId()), DiseasePhysical::getLocationId, location.getId()).last("limit 1")
.oneOpt()
.orElseGet(() -> {
@ -72,6 +76,8 @@ public class AskPhysicalServiceImpl implements AskPhysicalService {
diseasePhysical.setResult("无相关资讯");
return diseasePhysical;
});
}
// 检查记录保存到数据库中
DiagnosisPhysicalRecord diagnosisPhysicalRecord = new DiagnosisPhysicalRecord();
diagnosisPhysicalRecord.setProcessId(process.getId());

Loading…
Cancel
Save