From aa96ef66c63bfc92783ce484ca432dc7ea65b354 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Dec 2025 11:39:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=9A=E9=80=89?= =?UTF-8?q?=E5=AF=BC=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FileDocProcess/ExcelExportHelper.cs | 42 ++++++++++++++++++- .../Service/Common/ExcelExportService.cs | 10 ++--- .../Service/QC/DTO/QCListViewModel.cs | 3 ++ .../Service/QC/_MapConfig.cs | 9 ++-- 4 files changed, 55 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs index 87696b93e..f699de4bc 100644 --- a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs @@ -1,15 +1,19 @@ using DocumentFormat.OpenXml.Spreadsheet; using DocumentFormat.OpenXml.Wordprocessing; +using FellowOakDicom.Imaging.LUT; using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson; using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Migrations; +using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Hosting; using MiniExcelLibs; using MiniExcelLibs.OpenXml; +using Newtonsoft.Json; using NPOI.HSSF.UserModel; using NPOI.SS.Formula.Functions; using NPOI.SS.UserModel; @@ -681,9 +685,45 @@ public static class ExcelExportHelper if (itemDicName.IsNotNullOrEmpty()) { - var translatedItemData = dynamicTranslateDataList[itemDicName].Where(t => t.Code.ToLower() == itemValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; + var optionTypeEnumStr = iteObjDic.ContainsKey("OptionTypeEnum") ? iteObjDic["OptionTypeEnum"]?.ToString() : "0"; + + var translatedItemData = ""; + //多选 + if (optionTypeEnumStr == "1") + { + int[] enumValues = new int[0]; + // 1. 反序列化 JSON 数组 (字符串枚举) + if (!itemValue.StartsWith("[") || !itemValue.EndsWith("]")) + { + enumValues = new int[1] { int.Parse(itemValue) }; + } + else + { + enumValues = JsonConvert.DeserializeObject(itemValue)?? new int[0]; + + } + + + // 2. 翻译每一项并输出逗号拼接字符串 + translatedItemData = string.Join(",", + enumValues.Select(code => + dynamicTranslateDataList[itemDicName] + .FirstOrDefault(t => + string.Equals(code.ToString(),t.Code, StringComparison.OrdinalIgnoreCase) + ) is var r && r != null + ? (isEn_US ? r.Value : r.ValueCN) + : string.Empty + )); + } + else + { + + translatedItemData = dynamicTranslateDataList[itemDicName].Where(t => t.Code.ToLower() == itemValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; + + } row.GetCell(writeIndex).SetCellValue(translatedItemData); + } else { diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 203ec15a3..d2525dc60 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -3168,7 +3168,7 @@ namespace IRaCIS.Core.Application.Service.Common addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = lession.LessionType, TranslateDicName = "LesionType" }); } - var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName }); + var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, OptionTypeEnum = t.OptionTypeEnum, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName }); //有三部分组成 外层问题+ 没有配置病灶编号和类型+ 动态的表格问题 var dynamicLessionInfoList = item.QuestionAnswerList.Union(addLessionInfoList).Union(dynamicPartialLessionInfoList).ToList(); @@ -3316,14 +3316,14 @@ namespace IRaCIS.Core.Application.Service.Common addLessionInfoList.Add(new CommonQuesionInfo() { QuestionId = Guid.Empty, QuestionName = _userInfo.IsEn_Us ? "Table Name" : "表格名称", QuestionValue = firstLessionAnser.TableName }); - var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionId = t.TableQuesionId, QuestionName = t.TableName + "_" + t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode }); + var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionId = t.TableQuesionId, OptionTypeEnum = t.OptionTypeEnum, QuestionName = t.TableName + "_" + t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode }); //有三部分组成 外层问题+ 固定列表格名称 + 动态的表格问题 dynamicLessionInfoList = item.QuestionAnswerList.Union(addLessionInfoList).Union(dynamicPartialLessionInfoList).ToList(); } else { - var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionId = t.TableQuesionId, QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode }); + var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionId = t.TableQuesionId, OptionTypeEnum = t.OptionTypeEnum, QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode }); //两部分组成 外层问题+ 动态的表格问题 dynamicLessionInfoList = item.QuestionAnswerList.Union(dynamicPartialLessionInfoList).ToList(); @@ -3389,7 +3389,7 @@ namespace IRaCIS.Core.Application.Service.Common var trialConfigTableQuestionList = _trialReadingTableQuestionRepository.Where(t => t.TrialId == trialId && t.TrialCriterionId == trialReadingCriterionId).Where(t => t.ExportResultStr.Contains(((int)inQuery.ReadingExportType).ToString())) .Select(t => new ExportQuestionBasicInfo() { - QuestionId = t.Id, + QuestionId = t.Id, TableName = _userInfo.IsEn_Us ? t.ReadingQuestionTrial.QuestionEnName : t.ReadingQuestionTrial.QuestionName, QuestionName = _userInfo.IsEn_Us ? t.QuestionEnName : t.QuestionName, CDISCCode = t.CDISCCode, @@ -3433,7 +3433,7 @@ namespace IRaCIS.Core.Application.Service.Common var dynamicLessionInfoList = new List(); - var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionId = t.TableQuesionId, QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode }); + var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionId = t.TableQuesionId,OptionTypeEnum=t.OptionTypeEnum, QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode }); //两部分组成 外层问题+ 动态的表格问题 dynamicLessionInfoList = item.QuestionAnswerList.Union(dynamicPartialLessionInfoList).ToList(); diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 1c2629107..5d9739c46 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -1256,6 +1256,8 @@ namespace IRaCIS.Core.Application.Contracts //问题标识,肿瘤评估用于区分是什么问题 public QuestionType? QuestionType { get; set; } + public OptionType OptionTypeEnum { get; set; } + public Guid QuestionId { get; set; } public string QuestionName { get; set; } @@ -1421,6 +1423,7 @@ namespace IRaCIS.Core.Application.Contracts public string TableName { get; set; } #endregion + public OptionType OptionTypeEnum { get; set; } public Guid TableQuesionId { get; set; } diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 665a24f11..0b447c4e7 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -246,6 +246,7 @@ namespace IRaCIS.Core.Application.Service .OrderBy(k => k.ReadingQuestionTrial.ShowOrder) .Select(c => new CommonQuesionInfo() { + OptionTypeEnum=c.ReadingQuestionTrial.OptionTypeEnum, QuestionType = c.ReadingQuestionTrial.QuestionType, QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName, QuestionValue = c.IsGlobalChange ? c.GlobalChangeAnswer : c.Answer, @@ -286,6 +287,7 @@ namespace IRaCIS.Core.Application.Service .Select(c => new CommonQuesionInfo() { QuestionType = c.ReadingQuestionTrial.QuestionType, + OptionTypeEnum=c.ReadingQuestionTrial.OptionTypeEnum, QuestionId = c.ReadingQuestionTrial.Id, QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName, QuestionValue = c.IsGlobalChange ? c.GlobalChangeAnswer : c.Answer, @@ -304,9 +306,10 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.LessionAnswerList, t => t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.ExportResultStr.Contains(((int)readingExportType).ToString())))); CreateMap() - //.ForMember(o => o.LessionCode, t => t.MapFrom(u => u.Lesion.RowMark)) - //.ForMember(o => o.LessionType, t => t.MapFrom(u => (int?)u.ReadingQuestionTrial.LesionType)) - .ForMember(o => o.ShowOrder, t => t.MapFrom(u => u.ReadingTableQuestionTrial.ShowOrder)) + //.ForMember(o => o.LessionCode, t => t.MapFrom(u => u.Lesion.RowMark)) + //.ForMember(o => o.LessionType, t => t.MapFrom(u => (int?)u.ReadingQuestionTrial.LesionType)) + .ForMember(o => o.OptionTypeEnum, t => t.MapFrom(u => u.ReadingTableQuestionTrial.OptionTypeEnum)) + .ForMember(o => o.ShowOrder, t => t.MapFrom(u => u.ReadingTableQuestionTrial.ShowOrder)) .ForMember(o => o.CustomUnit, t => t.MapFrom(u => u.ReadingTableQuestionTrial.CustomUnit)) .ForMember(o => o.Unit, t => t.MapFrom(u => u.ReadingTableQuestionTrial.Unit)) .ForMember(o => o.TableQuesionId, t => t.MapFrom(u => u.ReadingTableQuestionTrial.Id)) From a592a39fae9ceb0379041ed25bf4e4761bde2f93 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Dec 2025 13:28:18 +0800 Subject: [PATCH 2/5] =?UTF-8?q?ivus-oct-=E5=AF=BC=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9-uat-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/Export/IVUS_OCTExportService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs index 5e824492a..abb0d9279 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs @@ -226,6 +226,7 @@ public class IVUS_OCTExportService(IRepository _r .Select(t => new IVUS_OCTBaseDto() { ResearchProgramNo = t.Trial.ResearchProgramNo, + TrialSiteCode=t.Subject.TrialSite.TrialSiteCode, SubjectCode = t.Subject.Code, UserName = t.DoctorUser.UserName, ArmEnum = t.ArmEnum, @@ -431,7 +432,7 @@ public class IVUS_OCTExportService(IRepository _r ivus.TOTALPA = findStatLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.EEMSubtractLumenSum).FirstOrDefault()?.QuestionValue ?? string.Empty; //冠状动脉粥样硬化体积百分比(PAV) - ivus.TOTALPA = findPAVLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.PAV).FirstOrDefault()?.QuestionValue ?? string.Empty; + ivus.PAV = findPAVLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.PAV).FirstOrDefault()?.QuestionValue ?? string.Empty; ivusList.Add(ivus); From 7a0b29bda63019baad8614b2fe50004e34fd1c93 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Dec 2025 14:37:42 +0800 Subject: [PATCH 3/5] =?UTF-8?q?ivus-oct-=E5=AF=BC=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9-uat-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/Export/CDISCExportBaseModel.cs | 4 + .../Common/Export/IVUS_OCTExportService.cs | 94 ++++++++++++++----- 2 files changed, 77 insertions(+), 21 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/Export/CDISCExportBaseModel.cs b/IRaCIS.Core.Application/Service/Common/Export/CDISCExportBaseModel.cs index ebcebb267..5ad053587 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/CDISCExportBaseModel.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/CDISCExportBaseModel.cs @@ -15,6 +15,8 @@ public class TumorCommonQustionInfo //问题标识,肿瘤评估用于区分是什么问题 public QuestionType? QuestionType { get; set; } + public OptionType OptionTypeEnum { get; set; } + public Guid QuestionId { get; set; } public string QuestionName { get; set; } @@ -51,6 +53,8 @@ public class TumorLessionAnswerInfo { public QuestionMark? QuestionMark { get; set; } + public OptionType OptionTypeEnum { get; set; } + //病灶Id public Guid RowId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs index abb0d9279..64cb33046 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs @@ -1,4 +1,5 @@ -using IRaCIS.Application.Contracts; +using DocumentFormat.OpenXml.Spreadsheet; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.ViewModel; @@ -10,7 +11,9 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using MiniExcelLibs; using MiniExcelLibs.OpenXml; +using Newtonsoft.Json; using NPOI.SS.Formula.Functions; +using Org.BouncyCastle.Asn1.X509; using System; using System.Collections; using System.Collections.Generic; @@ -226,7 +229,7 @@ public class IVUS_OCTExportService(IRepository _r .Select(t => new IVUS_OCTBaseDto() { ResearchProgramNo = t.Trial.ResearchProgramNo, - TrialSiteCode=t.Subject.TrialSite.TrialSiteCode, + TrialSiteCode = t.Subject.TrialSite.TrialSiteCode, SubjectCode = t.Subject.Code, UserName = t.DoctorUser.UserName, ArmEnum = t.ArmEnum, @@ -279,6 +282,7 @@ public class IVUS_OCTExportService(IRepository _r .Select(c => new TumorCommonQustionInfo() { QuestionType = c.ReadingQuestionTrial.QuestionType, + OptionTypeEnum = c.ReadingQuestionTrial.OptionTypeEnum, QuestionId = c.ReadingQuestionTrial.Id, QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName, QuestionValue = c.IsGlobalChange ? c.GlobalChangeAnswer : c.Answer, @@ -301,6 +305,7 @@ public class IVUS_OCTExportService(IRepository _r { RowId = k.RowId, + OptionTypeEnum = k.ReadingTableQuestionTrial.OptionTypeEnum, TranslateDicName = k.ReadingTableQuestionTrial.DictionaryCode, QuestionMark = k.ReadingTableQuestionTrial.QuestionMark, TableQuesionId = k.ReadingTableQuestionTrial.Id, @@ -359,8 +364,11 @@ public class IVUS_OCTExportService(IRepository _r #region 字典和各个表的数组准备 - var dicNameList = new List() { "ArmEnum", "ValueUnit" } - .Distinct().ToArray(); + var dicNameList = taskList.SelectMany(t => t.QuestionAnswerList).Select(t => t.TranslateDicName) + .Union(taskList.SelectMany(t => t.LesionList).SelectMany(t => t.LessionAnswerList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(c => c.TranslateDicName)) + .Union(new List() { "ArmEnum", "ValueUnit" }) + .Distinct().ToArray(); + //翻译字典 var translateDataList = await _dictionaryService.GetBasicDataSelect(dicNameList); @@ -393,7 +401,9 @@ public class IVUS_OCTExportService(IRepository _r //靶段 - ivus.TARGETV = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault()?.QuestionValue ?? string.Empty; + var target = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault(); + + ivus.TARGETV = translateDataList[target?.TranslateDicName].Where(t => t.Code.ToLower() == target?.QuestionValue?.ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; var marks = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegmentRemarks).FirstOrDefault()?.QuestionValue ?? string.Empty; @@ -460,12 +470,12 @@ public class IVUS_OCTExportService(IRepository _r { pNoIndex++; - foreach (var lessionAnswer in fctLesion?.LessionAnswerList.Where(t => t.QuestionMark != QuestionMark.PlaqueNumber).OrderBy(t=>t.ShowOrder)) + foreach (var lessionAnswer in fctLesion?.LessionAnswerList.Where(t => t.QuestionMark != QuestionMark.PlaqueNumber).OrderBy(t => t.ShowOrder)) { var mark = string.Empty; switch (lessionAnswer.QuestionMark) { - + case QuestionMark.FirstFCT: mark = "FCTMV1"; break; @@ -476,30 +486,30 @@ public class IVUS_OCTExportService(IRepository _r mark = "FCTMV3"; break; case QuestionMark.AvgFCT: - mark = "AVGFCT"; - break; - case QuestionMark.MacrophageInfiltration: + mark = "AVGFCT"; + break; + case QuestionMark.MacrophageInfiltrationMeasurement: mark = "MACRI"; break; - case QuestionMark.MacrophageExtensionAngle: + case QuestionMark.MacrophageInfiltrationAngle: mark = "MIARC"; break; - case QuestionMark.Microchannels: + case QuestionMark.MicrochannelMeasurement: mark = "MC"; break; - case QuestionMark.CholesterolCrystallization: + case QuestionMark.CholesterolCrystalMeasurement: mark = "CCS"; break; - case QuestionMark.LumenArea: + case QuestionMark.LumenAreaMeasurement: mark = "LUMEN"; break; - + } if (mark.IsNotNullOrEmpty()) { - var oct = CreatOCT(task, pNo); + var oct = CreatOCT(task, pNo, translateDataList); // 测量标识 阅片人_斑块号_表格_行号 @@ -630,7 +640,7 @@ public class IVUS_OCTExportService(IRepository _r if (findAngle != null) { - var oct = CreatOCT(task, pNo); + var oct = CreatOCT(task, pNo, translateDataList); // 测量标识 @@ -698,15 +708,20 @@ public class IVUS_OCTExportService(IRepository _r } - private OctExportDto CreatOCT(IVUS_OCTBaseDto task, string pNo) + private OctExportDto CreatOCT(IVUS_OCTBaseDto task, string pNo, Dictionary> translateDataList) { + + var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US; + var oct = _mapper.Map(task); //靶段 - //靶段 - oct.TARGETV = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault()?.QuestionValue ?? string.Empty; + + var target = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegment).FirstOrDefault(); + + oct.TARGETV = translateDataList[target?.TranslateDicName].Where(t => t.Code.ToLower() == target?.QuestionValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; var marks = task.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.TargetSegmentRemarks).FirstOrDefault()?.QuestionValue ?? string.Empty; @@ -723,7 +738,44 @@ public class IVUS_OCTExportService(IRepository _r && t.LessionAnswerList.Any(t => t.QuestionMark == QuestionMark.PlaqueNumber && t.QuestionValue == pNo)).FirstOrDefault(); // 斑块类型 - oct.PLATYPE = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.Undetermined).FirstOrDefault()?.QuestionValue ?? string.Empty; + var undetermined = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.Undetermined).FirstOrDefault(); + + if (undetermined?.OptionTypeEnum == OptionType.Multiple) + { + var qValue = undetermined?.QuestionValue; + int[] enumValues = new int[0]; + // 1. 反序列化 JSON 数组 (字符串枚举) + if (!qValue.StartsWith("[") || !qValue.EndsWith("]")) + { + enumValues = new int[1] { int.Parse(qValue) }; + } + else + { + enumValues = JsonConvert.DeserializeObject(qValue) ?? new int[0]; + + } + + // 2. 翻译每一项并输出逗号拼接字符串 + var tValue = string.Join(",", + enumValues.Select(code => + translateDataList[undetermined.TranslateDicName] + .FirstOrDefault(t => + string.Equals(code.ToString(), t.Code, StringComparison.OrdinalIgnoreCase) + ) is var r && r != null + ? (isEn_US ? r.Value : r.ValueCN) + : string.Empty + )); + + oct.PLATYPE = tValue; + } + else + { + oct.PLATYPE = translateDataList[undetermined?.TranslateDicName].Where(t => t.Code.ToLower() == undetermined?.QuestionValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; + + } + + + // 匹配动脉段最小FCT oct.MINFCT = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MiniMumFCT).FirstOrDefault()?.QuestionValue ?? string.Empty; // 平均最小FCT From 73889c51ae50a9b39f133b126a79a22b790f76eb Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Dec 2025 17:41:46 +0800 Subject: [PATCH 4/5] =?UTF-8?q?ivus-oct-=E5=AF=BC=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9-uat-3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/Export/IVUS_OCTExportService.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs index 64cb33046..7100b026a 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs @@ -520,7 +520,17 @@ public class IVUS_OCTExportService(IRepository _r oct.TESTCD = mark; // 测量参数值 - oct.ORRES = lessionAnswer?.QuestionValue ?? string.Empty; + + if (lessionAnswer.TranslateDicName.IsNotNullOrEmpty()) + { + oct.ORRES = translateDataList[lessionAnswer.TranslateDicName].Where(t => t.Code.ToLower() == lessionAnswer.QuestionValue?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; + } + else + { + oct.ORRES = lessionAnswer?.QuestionValue ?? string.Empty; + + } + // 测量值单位 oct.ORRESU = translateDataList["ValueUnit"].Where(t => t.Code.ToLower() == ((int?)lessionAnswer.Unit)?.ToString().ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; From 024e62103a4bd0919404842488617292680bf3ae Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Dec 2025 17:48:14 +0800 Subject: [PATCH 5/5] =?UTF-8?q?ivus-oct-=E5=AF=BC=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9-uat-4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/Export/IVUS_OCTExportService.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs index 7100b026a..105f3c365 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/IVUS_OCTExportService.cs @@ -795,13 +795,19 @@ public class IVUS_OCTExportService(IRepository _r // 脂质角度最大值 oct.LAMAX = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MaxAvgLipidAngle).FirstOrDefault()?.QuestionValue ?? string.Empty; // 巨噬细胞浸润 - oct.PLAMACRI = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MacrophageInfiltration).FirstOrDefault()?.QuestionValue ?? string.Empty; + + var macri = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MacrophageInfiltration).FirstOrDefault(); + oct.PLAMACRI = translateDataList[macri?.TranslateDicName].Where(t => t.Code.ToLower() == macri?.QuestionValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; // 巨噬细胞浸润角度 oct.PLAMIARC = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.MacrophageExtensionAngle).FirstOrDefault()?.QuestionValue ?? string.Empty; // 微通道 - oct.PLAMC = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.Microchannels).FirstOrDefault()?.QuestionValue ?? string.Empty; + + var mc = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.Microchannels).FirstOrDefault(); + oct.PLAMC = translateDataList[mc?.TranslateDicName].Where(t => t.Code.ToLower() == mc?.QuestionValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; // 胆固醇结晶 - oct.PLACCS = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.CholesterolCrystallization).FirstOrDefault()?.QuestionValue ?? string.Empty; + + var ccs = findLession?.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.CholesterolCrystallization).FirstOrDefault(); + oct.PLACCS = translateDataList[ccs?.TranslateDicName].Where(t => t.Code.ToLower() == ccs?.QuestionValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; return oct; }