From b382634173db36f8a710cd28ac8599d21048f24f Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Tue, 17 Dec 2024 13:31:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BF=83=E7=94=B5?= =?UTF-8?q?=E5=9B=BE=E5=90=84=E9=A1=B9=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PatientexamlistController.java | 43 +++++++++++++++++++ .../vo/ECGStatisticsRespVO.java | 26 +++++++++++ 2 files changed, 69 insertions(+) create mode 100644 yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/ECGStatisticsRespVO.java 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 4a32fd057..afb53a20a 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 @@ -61,6 +61,8 @@ import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + @Tag(name = "管理后台 - PACS检查列表") @RestController @RequestMapping("/tblist/patientexamlist") @@ -525,4 +527,45 @@ public class PatientexamlistController { } + @GetMapping("/getECGStatistics") + @Operation(summary = "获取心电图统计数据") + @PreAuthorize("@ss.hasPermission('tblist:patientexamlist:query')") + public CommonResult getECGStatistics() { + ECGStatisticsRespVO statistics = new ECGStatisticsRespVO(); + + // 构建基础查询条件 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("deviceType", "ECG"); + + // 获取总数 + int totalCount = patientexamlistMapper.selectCount(queryWrapper).intValue(); + statistics.setTotalCount(totalCount); + + // 获取已分析数量(reviewDate不为空) + QueryWrapper analyzedWrapper = new QueryWrapper<>(); + analyzedWrapper.eq("deviceType", "ECG") + .isNotNull("reviewDate"); + int analyzedCount = patientexamlistMapper.selectCount(analyzedWrapper).intValue(); + statistics.setAnalyzedCount(analyzedCount); + + // 获取未分析数量 + statistics.setUnanalyzedCount(totalCount - analyzedCount); + + // 获取阳性数量 + QueryWrapper positiveWrapper = new QueryWrapper<>(); + positiveWrapper.eq("deviceType", "ECG") + .eq("wholeDiagFlag", "1"); // 假设 wholeDiagFlag=1 表示阳性 + int positiveCount = patientexamlistMapper.selectCount(positiveWrapper).intValue(); + statistics.setPositiveCount(positiveCount); + + // 获取上级申请数量(applicationDate不为空) + QueryWrapper appliedWrapper = new QueryWrapper<>(); + appliedWrapper.eq("deviceType", "ECG") + .isNotNull("applicationDate"); + int appliedCount = patientexamlistMapper.selectCount(appliedWrapper).intValue(); + statistics.setAppliedCount(appliedCount); + + return success(statistics); + } + } \ 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/ECGStatisticsRespVO.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/ECGStatisticsRespVO.java new file mode 100644 index 000000000..8359bfadd --- /dev/null +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/ECGStatisticsRespVO.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.tblist.controller.admin.patientexamlist.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.ToString; + +@Schema(description = "心电图统计数据 Response VO") +@Data +@ToString(callSuper = true) +public class ECGStatisticsRespVO { + + @Schema(description = "心电图数据总数") + private Integer totalCount; + + @Schema(description = "已分析数量") + private Integer analyzedCount; + + @Schema(description = "未分析数量") + private Integer unanalyzedCount; + + @Schema(description = "阳性数量") + private Integer positiveCount; + + @Schema(description = "上级申请数量") + private Integer appliedCount; +} \ No newline at end of file From e29fa7b93723ed6a28e51a21eb4ac34b3132764d Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Tue, 17 Dec 2024 15:23:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BF=83=E7=94=B5?= =?UTF-8?q?=E5=9B=BE=E5=90=84=E9=A1=B9=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2-=E5=8D=B1=E6=80=A5=E5=80=BC=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=92=8C=E9=98=B3=E6=80=A7=E6=95=B0=E6=8D=AE=E6=80=BB?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PatientexamlistController.java | 54 ++++++++++++++++--- .../vo/ECGStatisticsRespVO.java | 3 ++ 2 files changed, 49 insertions(+), 8 deletions(-) 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 afb53a20a..b323a0128 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 @@ -63,6 +63,9 @@ import javax.validation.Valid; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import cn.iocoder.yudao.module.tblist.dal.mysql.positivestatistics.PositivestatisticsMapper; +import cn.iocoder.yudao.module.tblist.dal.mysql.ecganalysisparas.EcganalysisparasMapper; + @Tag(name = "管理后台 - PACS检查列表") @RestController @RequestMapping("/tblist/patientexamlist") @@ -82,6 +85,10 @@ public class PatientexamlistController { private OrgUnitService Service; @Resource private ConfigService configService; + @Resource + private PositivestatisticsMapper positivestatisticsMapper; + @Resource + private EcganalysisparasMapper ecganalysisparasMapper; @PostMapping("/create") @Operation(summary = "创建PACS检查列表") @@ -530,12 +537,13 @@ public class PatientexamlistController { @GetMapping("/getECGStatistics") @Operation(summary = "获取心电图统计数据") @PreAuthorize("@ss.hasPermission('tblist:patientexamlist:query')") - public CommonResult getECGStatistics() { + public CommonResult getECGStatistics(@RequestParam("orgId") String orgId) { ECGStatisticsRespVO statistics = new ECGStatisticsRespVO(); // 构建基础查询条件 QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("deviceType", "ECG"); + queryWrapper.eq("deviceType", "ECG") + .eq("orgId", orgId); // 获取总数 int totalCount = patientexamlistMapper.selectCount(queryWrapper).intValue(); @@ -544,7 +552,8 @@ public class PatientexamlistController { // 获取已分析数量(reviewDate不为空) QueryWrapper analyzedWrapper = new QueryWrapper<>(); analyzedWrapper.eq("deviceType", "ECG") - .isNotNull("reviewDate"); + .eq("orgId", orgId) + .isNotNull("reviewDate"); int analyzedCount = patientexamlistMapper.selectCount(analyzedWrapper).intValue(); statistics.setAnalyzedCount(analyzedCount); @@ -552,19 +561,48 @@ public class PatientexamlistController { statistics.setUnanalyzedCount(totalCount - analyzedCount); // 获取阳性数量 - QueryWrapper positiveWrapper = new QueryWrapper<>(); - positiveWrapper.eq("deviceType", "ECG") - .eq("wholeDiagFlag", "1"); // 假设 wholeDiagFlag=1 表示阳性 - int positiveCount = patientexamlistMapper.selectCount(positiveWrapper).intValue(); + int positiveCount = 0; + // 1. 获取所有阳性关键词配置 + List> positivestatisticsDict = positivestatisticsMapper.selectList_usable(orgId); + if (positivestatisticsDict != null && !positivestatisticsDict.isEmpty()) { + // 2. 收集所有关键词 + List allKeywords = new ArrayList<>(); + for (Map dict : positivestatisticsDict) { + if (dict.get("keyWord") != null && dict.get("keyWord").toString().trim().length() > 0) { + String[] keywords = dict.get("keyWord").toString().trim().split(","); + allKeywords.addAll(Arrays.asList(keywords)); + } + } + + // 3. 一次性查询所有符合任意关键词的记录 + if (!allKeywords.isEmpty()) { + positiveCount = ecganalysisparasMapper.selectList_positive( + orgId, // 机构ID + null, // 不限制开始时间 + null, // 不限制结束时间 + allKeywords.toArray(new String[0]) + ).size(); + } + } + statistics.setPositiveCount(positiveCount); // 获取上级申请数量(applicationDate不为空) QueryWrapper appliedWrapper = new QueryWrapper<>(); appliedWrapper.eq("deviceType", "ECG") - .isNotNull("applicationDate"); + .eq("orgId", orgId) + .isNotNull("applicationDate"); int appliedCount = patientexamlistMapper.selectCount(appliedWrapper).intValue(); statistics.setAppliedCount(appliedCount); + // 获取危急值数量(warning = 1) + QueryWrapper criticalWrapper = new QueryWrapper<>(); + criticalWrapper.eq("deviceType", "ECG") + .eq("orgId", orgId) + .eq("warning", "1"); + int criticalCount = patientexamlistMapper.selectCount(criticalWrapper).intValue(); + statistics.setCriticalCount(criticalCount); + return success(statistics); } diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/ECGStatisticsRespVO.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/ECGStatisticsRespVO.java index 8359bfadd..9a15a9ce3 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/ECGStatisticsRespVO.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/ECGStatisticsRespVO.java @@ -23,4 +23,7 @@ public class ECGStatisticsRespVO { @Schema(description = "上级申请数量") private Integer appliedCount; + + @Schema(description = "危急值数量") + private Integer criticalCount; } \ No newline at end of file