diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java index aa406a076..65d697fe1 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java @@ -173,4 +173,14 @@ public class DateUtils { // 格式化为所需的格式 return String.format("%06d.%06d", totalSeconds, 0); } + /** + * 出生日期计算年龄 + * + */ + public static String calculateAge(LocalDateTime birthDateTime) { + // 从LocalDateTime获取出生的日期部分 + LocalDate birthDate = birthDateTime.toLocalDate(); + LocalDate currentDate = LocalDate.now(); // 获取当前日期 + return String.valueOf(Period.between(birthDate, currentDate).getYears()); // 计算两个日期之间的年份差 + } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/JwtTokenAutoConfiguration.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/JwtTokenAutoConfiguration.java index 5d3975934..7c98f8abf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/JwtTokenAutoConfiguration.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/outapi/JwtTokenAutoConfiguration.java @@ -11,6 +11,7 @@ public class JwtTokenAutoConfiguration implements WebMvcConfigurer { public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new JwtTokenInterceptor()) .addPathPatterns("/admin-api/ultrasoniccom/ultrasonic/InsImageInfo", + "/admin-api/tblist/patientexamlist/GetAnalysisInfo", "/admin-api/tblist/patientexamlist/addPatientExamInfo"); } } diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java index 64f15507d..aeb11bd75 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java @@ -1,8 +1,11 @@ package cn.iocoder.yudao.module.tblist.controller.admin.patientexamlist; +import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.module.tblist.service.patientexamlist.org.OrgService; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.mzt.logapi.starter.annotation.LogRecord; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -318,4 +321,71 @@ public class PatientexamlistController { patientexamlistService.updatePatientexamlist(updateReqVO); return success(true); } + + @GetMapping("/GetAnalysisInfo") + @Operation(summary = "获取报告信息") + public CommonResult GetAnalysisInfo(@RequestParam(value = "examId", required = false) String examId,@RequestParam("regId") String regId,@RequestParam("orgId") String orgId) + { + String msg=""; + + if (regId!=null &&!regId.isEmpty() && orgId!=null &&!orgId.isEmpty()) + { + Map params = new HashMap<>(); + params.put("regId", regId); + params.put("orgId", orgId); + if(examId!=null&&!examId.isEmpty()) + { + params.put("examId", examId); + } + List analysisInfoVOS=new ArrayList<>(); + List patientexamlistDOList= patientexamlistService.selectMp(params); + if(!patientexamlistDOList.isEmpty()) + { + for (PatientexamlistDO patientexamlistDO:patientexamlistDOList) + { + if(patientexamlistDO.getDiagDoctor()!=null &&!patientexamlistDO.getDiagDoctor().isEmpty()) + { + AnalysisInfoVO infoVO=new AnalysisInfoVO(); + infoVO.setExamId(patientexamlistDO.getExamId()); + infoVO.setRegId(patientexamlistDO.getRegId()); + infoVO.setPName(patientexamlistDO.getPName()); + infoVO.setGender(patientexamlistDO.getGender()); + infoVO.setAge(DateUtils.calculateAge(patientexamlistDO.getBirthday())); + infoVO.setDeviceName(patientexamlistDO.getDeviceName()); + infoVO.setExamItemName(patientexamlistDO.getExamItemName()); + infoVO.setExamDescription(patientexamlistDO.getExamDescription()); + infoVO.setDiagResults(patientexamlistDO.getDiagResults()); + infoVO.setDiagDoctor(patientexamlistDO.getDiagDoctor()); + infoVO.setDiagDate(patientexamlistDO.getDiagDate() != null ? patientexamlistDO.getDiagDate().toString() : null); + infoVO.setReviewDoctor(patientexamlistDO.getReviewDoctor()); + infoVO.setReviewDate(patientexamlistDO.getReviewDate()!=null ?patientexamlistDO.getReviewDate().toString():null); + infoVO.setCloudurl("http://114.55.171.231:48081/?no="+regId+"&&orgId="+orgId); + analysisInfoVOS.add(infoVO); + } + + } + if(!analysisInfoVOS.isEmpty()) + { + Gson gson = new GsonBuilder() + .serializeSpecialFloatingPointValues() // 序列化特殊浮点数值(如 NaN, Infinity) + .disableHtmlEscaping() // 禁用 HTML 转义 + .create(); + msg= gson.toJson(analysisInfoVOS); + } + else + { + msg="未查询到数据或数据未进行分析"; + } + + } + } + else + { + msg="参数为空"; + } + + return success(msg); + } + + } \ No newline at end of file diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/AnalysisInfoVO.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/AnalysisInfoVO.java new file mode 100644 index 000000000..1cc907f04 --- /dev/null +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/AnalysisInfoVO.java @@ -0,0 +1,52 @@ +package cn.iocoder.yudao.module.tblist.controller.admin.patientexamlist.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class AnalysisInfoVO { + + @Schema(description = "患者ID") + private String regId; + + @Schema(description = "检查ID") + private String examId; + + @Schema(description = "姓名") + private String pName; + + @Schema(description = "性别") + private String gender; + + @Schema(description = "年龄") + private String age; + + @Schema(description = "设备名称") + private String deviceName; + + @Schema(description = "检查项目") + private String examItemName; + + @Schema(description = "检查所见") + private String examDescription; + + @Schema(description = "诊断结论") + private String diagResults; + + @Schema(description = "下诊断医生") + private String diagDoctor; + + @Schema(description = "下诊断时间") + private String diagDate; + + @Schema(description = "审核人") + private String reviewDoctor; + + @Schema(description = "审核时间") + private String reviewDate; + + @Schema(description = "云胶片地址") + private String cloudurl; +} diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java index eafe8f914..fc4555798 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java @@ -112,4 +112,6 @@ public interface PatientexamlistService extends IService { * getCheckRecord */ Map getCheckRecord(String regId, String orgId); + + List selectMp(Map columnMap); } \ No newline at end of file diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java index ef870f610..88f5a45a2 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java @@ -322,5 +322,9 @@ public class PatientexamlistServiceImpl extends ServiceImpl selectMp(Map columnMap) + { + return patientexamlistMapper.selectByMap(columnMap); + } } \ No newline at end of file