From 1b6ba91240b34d5f1445563c89ab89fc60678264 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 19 Nov 2025 17:41:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=82=BF=E7=98=A4CDISC=20?= =?UTF-8?q?=E9=83=A8=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 6 + .../Common/Export/CDISCExportBaseModel.cs | 2 + .../Common/Export/TumorExportService.cs | 104 ++++++++++++++---- 3 files changed, 88 insertions(+), 24 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 1f684f5bb..47b2b88f4 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2691,6 +2691,12 @@ + + + 获取受试者级别 访视标注列表 + + + 受试者级别所有的影像 diff --git a/IRaCIS.Core.Application/Service/Common/Export/CDISCExportBaseModel.cs b/IRaCIS.Core.Application/Service/Common/Export/CDISCExportBaseModel.cs index 4562bab26..9e6623357 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/CDISCExportBaseModel.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/CDISCExportBaseModel.cs @@ -31,6 +31,8 @@ public class TumorCommonQustionInfo public class TumorLessionInfo { public Guid Id { get; set; } + + public Guid? OrganInfoId { get; set; } //病灶编号 public string LessionCode { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/Export/TumorExportService.cs b/IRaCIS.Core.Application/Service/Common/Export/TumorExportService.cs index d8846611c..edf4e678e 100644 --- a/IRaCIS.Core.Application/Service/Common/Export/TumorExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/Export/TumorExportService.cs @@ -12,6 +12,7 @@ using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; +using MailKit; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Hosting; @@ -313,6 +314,7 @@ public class Tumor_CDISC_ExportService(IRepository t.RowMark).Select(c => new TumorLessionInfo() { Id = c.Id, + OrganInfoId=c.OrganInfoId, LessionType = c.ReadingQuestionTrial.LesionType, LessionCode = c.RowMark, SplitRowId = c.SplitRowId, @@ -344,6 +346,7 @@ public class Tumor_CDISC_ExportService(IRepository GetTumor_CDISC_Export(VisitTaskQuery inQuery, [FromServices] IRepository _visitTaskReReadingRepository, [FromServices] IDictionaryService _dictionaryService, + [FromServices] IRepository _trialOrganRepository, [FromServices] IRepository _trialReadingQuestionRepository, [FromServices] IRepository _trialReadingTableQuestionRepository, [FromServices] IRepository _trialRepository) @@ -386,6 +389,11 @@ public class Tumor_CDISC_ExportService(IRepository() { "ArmEnum", "ValueUnit", "GlobalAssessType", "ImageQualityIssues" }) .Distinct().ToArray(); + var trialOrganDic = _trialOrganRepository.Where(t => t.TrialCriterionId == criterion.Id).Select(t=>new {t.OrganInfoId,t.Part,t.PartEN}).ToDictionary( + t => t.OrganInfoId, + t => new { t.Part, t.PartEN } + ); + //翻译字典 var translateDataList = await _dictionaryService.GetBasicDataSelect(dicNameList); @@ -512,6 +520,11 @@ public class Tumor_CDISC_ExportService(IRepository t.QuestionMark == QuestionMark.Part).FirstOrDefault(); + //var findBodyPart = lesion.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.Part).FirstOrDefault(); - if (findBodyPart != null) - { - if (findBodyPart.TranslateDicName.IsNotNullOrEmpty()) - { - tu.BodyPart = translateDataList[findBodyPart.TranslateDicName].Where(t => t.Code.ToLower() == findBodyPart.QuestionValue?.ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; - } - else - { - tu.BodyPart = findBodyPart.QuestionValue; - } - } + //if (findBodyPart != null) + //{ + // if (findBodyPart.TranslateDicName.IsNotNullOrEmpty()) + // { + // tu.BodyPart = translateDataList[findBodyPart.TranslateDicName].Where(t => t.Code.ToLower() == findBodyPart.QuestionValue?.ToLower()).Select(t => isEn_Us ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty; + // } + // else + // { + // tu.BodyPart = findBodyPart.QuestionValue; + // } + //} var findBodyPartDes = lesion.LessionAnswerList.Where(t => t.QuestionMark == QuestionMark.BodyPartDescription).FirstOrDefault(); @@ -1415,24 +1428,67 @@ public class Tumor_CDISC_ExportService(IRepository t.QuestionMark == QuestionMark.IsLymph && t.QuestionValue == "1") + ) + { + + trValueTypeIndex = 0; + } + //非淋巴结 存在 无法评估 消失 + + // 长径 空 0mm + + else if (lessionAnswer.QuestionMark == QuestionMark.MajorAxis + && lesion.LessionAnswerList.Any(t => t.QuestionMark == QuestionMark.IsLymph && t.QuestionValue == "0")) + { + trValueTypeIndex = 0; + + } + + if (lessionAnswer.QuestionMark == QuestionMark.MajorAxis || lessionAnswer.QuestionMark == QuestionMark.ShortAxis) + { + //处理消失 空为0mm + if (lessionAnswer.QuestionValue.IsNullOrEmpty() && lesion.LessionAnswerList.FirstOrDefault(t => t.QuestionMark == QuestionMark.State)?.QuestionValue == "3") + { + + lessionAnswer.QuestionValue = "0"; + } + } + + } - //淋巴结取短径 - else if (lessionAnswer.QuestionMark == QuestionMark.ShortAxis && lesion.LessionAnswerList.Any(t => t.QuestionMark == QuestionMark.IsLymph && t.QuestionValue == "1")) + //有值 就展示,没值就不展示 + else if (lesion.LessionType == LesionType.NonTargetLesions || lesion.LessionType == LesionType.NewLesions) { - - trValueTypeIndex = 0; - - } - //非淋巴结 并且长径有值 - else if (lessionAnswer.QuestionMark == QuestionMark.MajorAxis - && lesion.LessionAnswerList.Any(t => t.QuestionMark == QuestionMark.IsLymph && t.QuestionValue == "0") - && lesion.LessionAnswerList.FirstOrDefault(t => t.QuestionMark == QuestionMark.MajorAxis)?.QuestionValue.IsNotNullOrEmpty() == true) - { - trValueTypeIndex = 0; + //淋巴结取短径 并且短径有值 + if (lessionAnswer.QuestionMark == QuestionMark.ShortAxis + && lesion.LessionAnswerList.Any(t => t.QuestionMark == QuestionMark.IsLymph && t.QuestionValue == "1") + && lesion.LessionAnswerList.FirstOrDefault(t => t.QuestionMark == QuestionMark.ShortAxis)?.QuestionValue.IsNotNullOrEmpty() == true) + { + trValueTypeIndex = 0; + } + //非淋巴结取长径 并且长径有值 + else if (lessionAnswer.QuestionMark == QuestionMark.MajorAxis + && lesion.LessionAnswerList.Any(t => t.QuestionMark == QuestionMark.IsLymph && t.QuestionValue == "0") + && lesion.LessionAnswerList.FirstOrDefault(t => t.QuestionMark == QuestionMark.MajorAxis)?.QuestionValue.IsNotNullOrEmpty() == true) + { + trValueTypeIndex = 0; + } } + + + return trValueTypeIndex;