新增心电图各项数据统计查询-危急值数据和阳性数据总数
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
This commit is contained in:
parent
b382634173
commit
e29fa7b937
@ -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<ECGStatisticsRespVO> getECGStatistics() {
|
||||
public CommonResult<ECGStatisticsRespVO> getECGStatistics(@RequestParam("orgId") String orgId) {
|
||||
ECGStatisticsRespVO statistics = new ECGStatisticsRespVO();
|
||||
|
||||
// 构建基础查询条件
|
||||
QueryWrapper<PatientexamlistDO> 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<PatientexamlistDO> 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<PatientexamlistDO> positiveWrapper = new QueryWrapper<>();
|
||||
positiveWrapper.eq("deviceType", "ECG")
|
||||
.eq("wholeDiagFlag", "1"); // 假设 wholeDiagFlag=1 表示阳性
|
||||
int positiveCount = patientexamlistMapper.selectCount(positiveWrapper).intValue();
|
||||
int positiveCount = 0;
|
||||
// 1. 获取所有阳性关键词配置
|
||||
List<Map<String, Object>> positivestatisticsDict = positivestatisticsMapper.selectList_usable(orgId);
|
||||
if (positivestatisticsDict != null && !positivestatisticsDict.isEmpty()) {
|
||||
// 2. 收集所有关键词
|
||||
List<String> allKeywords = new ArrayList<>();
|
||||
for (Map<String, Object> 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<PatientexamlistDO> 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<PatientexamlistDO> 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);
|
||||
}
|
||||
|
||||
|
@ -23,4 +23,7 @@ public class ECGStatisticsRespVO {
|
||||
|
||||
@Schema(description = "上级申请数量")
|
||||
private Integer appliedCount;
|
||||
|
||||
@Schema(description = "危急值数量")
|
||||
private Integer criticalCount;
|
||||
}
|
Loading…
Reference in New Issue
Block a user