From 7873523c1b745082021a068b181496498c995f4a Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 18 Nov 2025 15:48:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingImageTaskViewModel.cs | 6 +- .../General/ReadingCalculateService.cs | 56 ++++++++++++++++--- IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs | 20 +++++-- 3 files changed, 69 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index bbe125b20..80dfdc035 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -449,12 +449,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public List VisitTaskNameList { get; set; } - public List ChartDataList { get; set; } + public List ChartDataList { get; set; } } - public class ChartData + public class ReportChartData { public string Name { get; set; } public List Value { get; set; } @@ -471,6 +471,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? TableQuestionId { get; set; } public decimal? RowIndex { get; set; } + + public ReportChartType? ReportChartTypeEnum { get; set; } } public class SetReadKeyFileInDto { diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs index 3dad1d6cc..466414166 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs @@ -4,6 +4,7 @@ using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infrastructure; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; @@ -257,21 +258,62 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate GetReportsChartDataOutDto result = new GetReportsChartDataOutDto() { VisitTaskNameList = data.VisitTaskList.Select(x => x.BlindName).ToList(), - ChartDataList=new List() { }, + ChartDataList=new List() { }, }; result.VisitTaskNameList = data.VisitTaskList.Select(x => x.BlindName).ToList(); + if (inDto.ReportChartTypeEnum != null) + { + switch (inDto.ReportChartTypeEnum) + { + case ReportChartType.Target: + { + // 这是病灶 + var target = data.TaskQuestions.SelectMany(x => x.Childrens) + .Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x=>x.Childrens) + .ToList(); + + foreach (var item in target) + { + ReportChartData chartData = new ReportChartData() + { + Name = item.QuestionName, + Value= new List(), + }; - if (inDto.QuestionId != null) + for (var i = 0; i < result.VisitTaskNameList.Count; i++) + { + // 淋巴结的短径 + if (item.Childrens.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer[i].Answer.EqEnum(ReadingYesOrNo.Yes))) + { + chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer[i].Answer).FirstOrDefault()); + } + else + { + chartData.Value.Add(item.Childrens.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer[i].Answer).FirstOrDefault()); + } + } + + result.ChartDataList.Add(chartData); + } + + } + break; + + default: + break; + } + } + else if (inDto.QuestionId != null) { var question = data.TaskQuestions.SelectMany(x => x.Childrens) .Where(x => x.QuestionId == inDto.QuestionId.Value).FirstOrDefault(); if (question != null) { - ChartData chartData = new ChartData() + ReportChartData chartData = new ReportChartData() { Name = question.QuestionName, Value = new List(), @@ -290,15 +332,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 问题 靶病灶 .SelectMany(x => x.Childrens) // 病灶 - .SelectMany(x => x.Childrens).Where(x=> x.RowIndex == inDto.RowIndex) + .SelectMany(x => x.Childrens).Where(x => x.RowIndex == inDto.RowIndex) // 表格问题 .SelectMany(x => x.Childrens).Where(x => x.TableQuestionId == inDto.TableQuestionId) - + .FirstOrDefault(); if (lesion != null) { - ChartData chartData = new ChartData() + ReportChartData chartData = new ReportChartData() { Name = lesion.QuestionName, Value = new List(), @@ -309,7 +351,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } result.ChartDataList.Add(chartData); } - + } diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 542480da4..8b0a540a0 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -2472,11 +2472,23 @@ public enum SUVChangeVSBaseline } + /// + /// 阅片图表类型 + /// + public enum ReportChartType + { + /// + /// 靶病灶 + /// + Target = 0, - /// - /// 问题类型 这里序号关系着计算顺序 请勿修改 - /// - public enum QuestionType + } + + + /// + /// 问题类型 这里序号关系着计算顺序 请勿修改 + /// + public enum QuestionType { /// /// 靶病灶径线之和(SOD)