From 7bc3378e0ccb4f37026fbc9ddbe53a7288845021 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Fri, 5 Sep 2025 09:50:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E6=94=B9IRes=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 16 ++++++ .../Reading/Dto/ReadingCalculateViewModel.cs | 2 +- .../General/GeneralCalculateService.cs | 24 ++++++++- .../IRECIST1Point1CalculateService.cs | 49 ++++++++++--------- .../Interface/IGeneralCalculateService.cs | 9 ++++ 5 files changed, 75 insertions(+), 25 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index aae0ae1c9..cffbdeaec 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2468,6 +2468,14 @@ + + + 获取项目问题名称 + + + + + 获取任务表格问题答案 @@ -5650,6 +5658,14 @@ + + + 获取项目问题名称 + + + + + 获取任务问题答案 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs index b22c927aa..b6451ed74 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs @@ -295,7 +295,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class ExportReportQuestion { - public string QuestionName { get; set; } + public string QuestionName { get; set; }=string.Empty; public QuestionType QuestionType { get; set; } } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs index 56f785710..77076f59c 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs @@ -842,6 +842,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } + /// + /// 获取项目问题名称 + /// + /// + /// + /// + [ApiExplorerSettings(IgnoreApi = true)] + public string GetTrialQuestionName(List? readingQuestionTrials,QuestionType questionType) + { + + var questionName = readingQuestionTrials.Where(x => x.QuestionType == questionType).Select(x =>_userInfo.IsEn_Us?x.QuestionEnName: x.QuestionName).FirstIsNullReturnEmpty(); + return questionName.TrimEnd(); + } + /// /// 获取任务表格问题答案 /// @@ -865,7 +879,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var answer = string.Empty; if (answerData.ReadingTableQuestionTrial.TableQuestionType == TableQuestionType.Dictionary) { - answer = dictionList.Where(x => x.Code == answerData.ReadingTableQuestionTrial.DictionaryCode).SelectMany(x => x.ChildList).Where(x => x.Code == answerData.Answer).Select(x => x.ValueCN).FirstIsNullReturnEmpty(); + if (_userInfo.IsEn_Us) + { + answer = dictionList.Where(x => x.Code == answerData.ReadingTableQuestionTrial.DictionaryCode).SelectMany(x => x.ChildList).Where(x => x.Code == answerData.Answer).Select(x => x.Value).FirstIsNullReturnEmpty(); + } + else + { + answer = dictionList.Where(x => x.Code == answerData.ReadingTableQuestionTrial.DictionaryCode).SelectMany(x => x.ChildList).Where(x => x.Code == answerData.Answer).Select(x => x.ValueCN).FirstIsNullReturnEmpty(); + } + } else diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index dc6642fcb..bad6f7a83 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -15,6 +15,7 @@ using Microsoft.Extensions.Options; using MiniSoftware; using System.Runtime.InteropServices; using System.Text; +using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -84,6 +85,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var doctor = await _userRoleRepository.Where(x => x.Id == taskinfo.DoctorUserId).FirstOrDefaultAsync(); var trialQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).ToListAsync(); + var tableQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionTrial.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).ToListAsync(); var dicotionCode = trialQuestion.Where(x => x.DictionaryCode != string.Empty).Select(x => x.DictionaryCode).Distinct().ToList(); dicotionCode.AddRange(tableQuestion.Where(x => x.DictionaryCode != string.Empty).Select(x => x.DictionaryCode).Distinct()); @@ -188,14 +190,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate #region 外层问题处理 // 获取外层问题 - List> getQuestionAnswerList(List exports) + async Task>> getQuestionAnswerList(List exports) { List> questionAnswerList = new List>(); foreach (var item in exports) { + item.QuestionName = _generalCalculateService.GetTrialQuestionName(trialQuestion, item.QuestionType); Dictionary questionAnswer = new Dictionary() { - {"Name",item.QuestionName }, + {"Name", item.QuestionName}, {"FirstVisit", _generalCalculateService.GetTaskanswer(answerList,dictionList,unitDictionary,taskIds[0],item.QuestionType)}, {"SecondVisit", relatedCount>=2? _generalCalculateService.GetTaskanswer(answerList,dictionList,unitDictionary,taskIds[1],item.QuestionType):string.Empty }, {"ThirdlyVisit", relatedCount>=3? _generalCalculateService.GetTaskanswer(answerList,dictionList,unitDictionary,taskIds[2],item.QuestionType):string.Empty }, @@ -228,13 +231,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var resultList = new List() - { new ExportReportQuestion (){ QuestionName="靶病灶径线之和(SOD)",QuestionType=QuestionType.SOD}, - new ExportReportQuestion (){ QuestionName="非淋巴结靶病灶长径之和",QuestionType=QuestionType.SumOfDiameter}, - new ExportReportQuestion (){ QuestionName="与基线相比SOD变化量",QuestionType=QuestionType.SODChange}, - new ExportReportQuestion (){ QuestionName="与基线相比SOD变化百分比",QuestionType=QuestionType.SODPercent}, - new ExportReportQuestion (){ QuestionName="与最低点相比SOD变化量",QuestionType=QuestionType.LowestIncrease}, - new ExportReportQuestion (){ QuestionName="与最低点相比SOD变化百分比",QuestionType=QuestionType.LowPercent}, - new ExportReportQuestion (){ QuestionName="最低点访视",QuestionType=QuestionType.LowVisit}, + { new ExportReportQuestion (){QuestionType=QuestionType.SOD}, + new ExportReportQuestion (){ QuestionType=QuestionType.SumOfDiameter}, + new ExportReportQuestion (){QuestionType=QuestionType.SODChange}, + new ExportReportQuestion (){ QuestionType=QuestionType.SODPercent}, + new ExportReportQuestion (){ QuestionType=QuestionType.LowestIncrease}, + new ExportReportQuestion (){QuestionType=QuestionType.LowPercent}, + new ExportReportQuestion (){QuestionType=QuestionType.LowVisit}, }; var isConvertedTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.IsConvertedTask).FirstOrDefaultAsync(); @@ -242,9 +245,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (isConvertedTask) { resultList.AddRange(new List() - { new ExportReportQuestion (){ QuestionName="与触发iRECIST访视相比SOD变化量",QuestionType=QuestionType.ComparedTriggeringSODChange}, - new ExportReportQuestion (){ QuestionName="新靶病灶直径之和(iSOD)",QuestionType=QuestionType.ISOD}, - new ExportReportQuestion (){ QuestionName="与触发iRECIST访视相比iSOD变化量",QuestionType=QuestionType.ComparedTriggeringiSODChange}, + { new ExportReportQuestion (){ QuestionType=QuestionType.ComparedTriggeringSODChange}, + new ExportReportQuestion (){ QuestionType=QuestionType.ISOD}, + new ExportReportQuestion (){ QuestionType=QuestionType.ComparedTriggeringiSODChange}, }); @@ -254,11 +257,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (visitInfo.IsBaseLine) { var existDisease = answerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ExistDisease).Select(x => x.Answer).FirstIsNullReturnEmpty().EqEnum(ExistDisease.No) ? "不" : string.Empty; - assessmentResult = $"{existDisease}存在疾病"; + assessmentResult = $"{existDisease}{_localizer["CriterionCalculateExport_ExistDisease"]}"; } else { - assessmentResult = $"整体肿瘤评估结果为{_generalCalculateService.GetTaskanswer(answerList, dictionList, unitDictionary, inDto.VisitTaskId, QuestionType.Tumor)}"; + assessmentResult = $"{_localizer["CriterionCalculateExport_AssessmentResult"]}{_generalCalculateService.GetTaskanswer(answerList, dictionList, unitDictionary, inDto.VisitTaskId, QuestionType.Tumor)}"; } var hIRHospital = await _hIRHospitalRepository.Where(t => t.IsDefault == true).FirstNotNullAsync(); @@ -268,8 +271,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { "HospitalName",hIRHospital.HospitalName } ,// 医院名称 { "SubjectName",subjectInfo.ShortName }, //患者姓名 - { "SubjectSex", subjectInfo.Sex==string.Empty?string.Empty: subjectInfo.Sex=="M"?"男":"女" }, //患者性别 - { "SubjectAge",subjectInfo.Age==null?string.Empty: subjectInfo.Age +"岁" }, //患者年龄 + { "SubjectSex", subjectInfo.Sex==string.Empty?string.Empty: subjectInfo.Sex=="M"?_localizer["CriterionCalculateExport_Man"]:_localizer["CriterionCalculateExport_Woman"] }, //患者性别 + { "SubjectAge",subjectInfo.Age==null?string.Empty: subjectInfo.Age +_localizer["CriterionCalculateExport_Years"] }, //患者年龄 { "SubjectCode",string.Join(",",patientIdStrList) }, //患者编号 { "VisitName",visitInfo.VisitName }, //访视名称 { "LatestScanDate",visitInfo.StudyList.Min(x=>x.StudyTime)?.ToString("yyyy-MM-dd") }, //随访日期 @@ -305,11 +308,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { "TNMValue",taskinfo.TNMValue}, // TNM分期 { "Result",getQuestionAnswerList(resultList)}, // 评估结果 { "Curative",getQuestionAnswerList(new List() - { new ExportReportQuestion (){ QuestionName="靶病灶评估",QuestionType=QuestionType.TargetLesion}, - new ExportReportQuestion (){ QuestionName="非靶病灶评估",QuestionType=QuestionType.NoTargetLesion}, - new ExportReportQuestion (){ QuestionName="存在新病灶",QuestionType=QuestionType.NewLesions}, - new ExportReportQuestion (){ QuestionName="存在疾病",QuestionType=QuestionType.ExistDisease}, - new ExportReportQuestion (){ QuestionName="整体肿瘤评估",QuestionType=QuestionType.Tumor}, + { new ExportReportQuestion (){QuestionType=QuestionType.TargetLesion}, + new ExportReportQuestion (){ QuestionType=QuestionType.NoTargetLesion}, + new ExportReportQuestion (){ QuestionType=QuestionType.NewLesions}, + new ExportReportQuestion (){ QuestionType=QuestionType.ExistDisease}, + new ExportReportQuestion (){ QuestionType=QuestionType.Tumor}, })}, // 疗效结果 { "ReportNo",await _generalCalculateService.GetReportExportNo(taskinfo) } , @@ -317,10 +320,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate value = _generalCalculateService.StringEmptyTurnedLine(value); - var templatePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"wwwroot/ReadReoprtTemplate/ReportTemplate_RECIST1.1_CN_V1.docx"); + var templatePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"wwwroot/ReadReoprtTemplate/ReportTemplate_RECIST1.1_{(_userInfo.IsEn_Us?"EN":"CN")}_V1.docx"); if (isConvertedTask) { - templatePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"wwwroot/ReadReoprtTemplate/ReportTemplate_IRECIST_CN_V1.docx"); + templatePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"wwwroot/ReadReoprtTemplate/ReportTemplate_IRECIST_{(_userInfo.IsEn_Us?"EN":"CN")}_V1.docx"); } var outputFilePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"wwwroot/ReadReoprtTemplate/downLoad/{inDto.DownLoadGuid}.docx"); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IGeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IGeneralCalculateService.cs index 51d9b0a57..e80e54abc 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IGeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IGeneralCalculateService.cs @@ -108,6 +108,15 @@ namespace IRaCIS.Core.Application.Service [ApiExplorerSettings(IgnoreApi = true)] Task>> GetLesionPic(List rowinfoList, LesionType lesionType, Guid downLoadGuid); + /// + /// 获取项目问题名称 + /// + /// + /// + /// + [ApiExplorerSettings(IgnoreApi = true)] + string GetTrialQuestionName(List? readingQuestionTrials, QuestionType questionType); + /// /// 获取任务问题答案 ///