阅片导出初步提交

IRC_NewDev
hang 2024-10-10 09:54:48 +08:00
parent 431d2e7a97
commit 1bb62fd134
9 changed files with 987 additions and 241 deletions

View File

@ -51,6 +51,7 @@
"ContinuousReadingTimeMin": 120,
"ReadingRestTimeMin": 10,
"IsNeedChangePassWord": true,
"ChangePassWordDays": 90

View File

@ -1,4 +1,6 @@
using IRaCIS.Application.Contracts;
using DocumentFormat.OpenXml.Spreadsheet;
using DocumentFormat.OpenXml.Wordprocessing;
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
using IRaCIS.Core.Application.Helper;
@ -195,15 +197,39 @@ public static class ExcelExportHelper
}
public class DynamicColumnConfig
{
public int AutoColumnStartIndex { get; set; }
public int AutoColumnRowIndex { get; set; }
public int BackMoveCount { get; set; }
public List<string> ColumnNameList { get; set; }
public List<string> TranslateDicNameList { get; set; }
//动态取数据的集合名
public string DynamicListName { get; set; }
public static async Task<(MemoryStream, string)> DataExport_NpoiTestAsync(string code, ExcelExportInfo data, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null)
//动态数据翻译的取字典的属性名
public string DynamicItemDicName { get; set; }
//取值的属性名
public string DynamicItemValueName { get; set; }
}
public static async Task<(MemoryStream, string)> DataExport_NpoiTestAsync(string code, ExcelExportInfo data, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null, DynamicColumnConfig? dynamicColumnConfig = null)
{
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
//判断是否有字典翻译
object translateData = data;
Dictionary<string, object> translatedDic = default;
if (_dictionaryService != null && translateType != null)
{
@ -284,6 +310,7 @@ public static class ExcelExportHelper
//data = dic;
translateData = dic;
translatedDic = dic;
}
@ -319,6 +346,41 @@ public static class ExcelExportHelper
workbook.RemoveSheetAt(1);
}
if (dynamicColumnConfig != null)
{
var sheet = workbook.GetSheetAt(0);
var row = sheet.GetRow(dynamicColumnConfig.AutoColumnRowIndex);
var templateRow = sheet.GetRow(dynamicColumnConfig.AutoColumnRowIndex + 1);
var needAddCount = dynamicColumnConfig.ColumnNameList.Count;
var colunmAddIndex = dynamicColumnConfig.AutoColumnStartIndex + dynamicColumnConfig.BackMoveCount;
//创建新的列
for (int i = 0; i < needAddCount; i++)
{
row.CreateCell(i + colunmAddIndex);
}
//移动Title 和下面的模板标识
for (int i = colunmAddIndex + needAddCount; i < colunmAddIndex; i--)
{
row.GetCell(i).SetCellValue(row.GetCell(i - needAddCount).StringCellValue);
templateRow.GetCell(i).SetCellValue(templateRow.GetCell(i - needAddCount).StringCellValue);
}
//设置动态Tilte
for (int i = dynamicColumnConfig.AutoColumnStartIndex; i < dynamicColumnConfig.AutoColumnStartIndex + needAddCount; i++)
{
var name = dynamicColumnConfig.ColumnNameList[i - dynamicColumnConfig.AutoColumnStartIndex];
row.GetCell(i).SetCellValue(name);
}
}
var memoryStream2 = new MemoryStream();
workbook.Write(memoryStream2, true);
@ -327,8 +389,6 @@ public static class ExcelExportHelper
templateStream = memoryStream2;
}
// 文件名称 从sheet里面取
//fileName = workbook.GetSheetName(0);
#endregion
#region MiniExcel
@ -345,11 +405,61 @@ public static class ExcelExportHelper
memoryStream.Seek(0, SeekOrigin.Begin);
if (dynamicColumnConfig != null)
{
var dynamicTranslateDataList = await _dictionaryService.GetBasicDataSelect(dynamicColumnConfig.TranslateDicNameList.ToArray());
// 使用NPOI 进行二次处理
var wb = new XSSFWorkbook(memoryStream);
var sheet = wb.GetSheetAt(0);
var list = translatedDic["List"] as IList;
foreach (var itemResult in list)
{
var index = list.IndexOf(itemResult);
//从第四行开始处理动态列
var row = sheet.GetRow(index + 3);
var itemDic = itemResult.ConvertToDictionary();
var itemList = itemDic[dynamicColumnConfig.DynamicListName] as IList;
foreach (var item in itemList)
{
var writeIndex = itemList.IndexOf(item) + dynamicColumnConfig.AutoColumnStartIndex;
var itemDicName = itemDic[dynamicColumnConfig.DynamicItemDicName].ToString();
var itemValue = itemDic[dynamicColumnConfig.DynamicItemValueName].ToString();
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;
row.GetCell(writeIndex).SetCellValue(translatedItemData);
}
else
{
row.GetCell(writeIndex).SetCellValue(itemValue);
}
}
}
var memoryStream2 = new MemoryStream();
wb.Write(memoryStream2, true);
memoryStream2.Seek(0, SeekOrigin.Begin);
memoryStream = memoryStream2;
}
return (memoryStream, fileName);
//var wb = new HSSFWorkbook(memoryStream);
//var sheet = wb.GetSheetAt(0);
#endregion
@ -413,7 +523,7 @@ public static class ExcelExportHelper
foreach (var property in inDto.Data.GetType().GetProperties())
{
var value = property.GetValue(inDto.Data);
if (cell!=null&&cell.ToString() == "{{" + property.Name + "}}")
if (cell != null && cell.ToString() == "{{" + property.Name + "}}")
{
sheet.GetRow(i).GetCell(j).SetCellValue(value.ToString());
}

View File

@ -729,6 +729,13 @@
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetInternationalizationList_Export(IRaCIS.Core.Application.ViewModel.InternationalizationQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Internationalization},IRaCIS.Application.Interfaces.IDictionaryService)">
<summary>
国际化导出
</summary>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetPatientList_Export(IRaCIS.Application.Contracts.PatientTrialQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SCPPatient},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
影像检查列表-患者为维度组织

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@ using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Domain.Share;
using MiniExcelLibs.Attributes;
using Newtonsoft.Json;
using Org.BouncyCastle.Asn1.X509;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@ -1028,6 +1029,48 @@ namespace IRaCIS.Core.Application.Contracts
}
public class CommonQuesionInfo
{
public string QuestionName { get; set; }
public string QuestionValue { get; set; }
public string TranslateDicName { get; set; }
}
public class CommonEvaluationExport : OverallTumorEvaluationExport
{
public List<CommonQuesionInfo> JudgeQuestionAnswerList { get; set; }
}
public class CommonEvaluationDetailExport : OverallTumorEvaluationExport
{
public List<CommonQuesionInfo> QuestionAnswerList { get; set; }
}
public class DoctorJudgeRatio
{
public Guid? DoctorUserId { get; set; }
public string UserName { get; set; }
public string FullName { get; set; }
public int TotalJudgeCount { get; set; }
public int JudgeAgreeCount { get; set; }
public string JudgeRatioStr => TotalJudgeCount == 0 ? $"NA" : $"{Math.Round((decimal)JudgeAgreeCount * 100 / TotalJudgeCount, 2)}%";
public string ExceptionMark => TotalJudgeCount == 0 ? $"Y" : (JudgeAgreeCount * 3 / TotalJudgeCount < 1) ? "Y" : "N";
}
public class OverallTumorEvaluationExport
{
public String TrialSiteCode { get; set; } = String.Empty;
@ -1053,30 +1096,37 @@ namespace IRaCIS.Core.Application.Contracts
public ReadingCategory ReadingCategory { get; set; }
[DictionaryTranslateAttribute("ExistDisease", CriterionType.Lugano2014, nameof(OverallTumorEvaluationExport.IsBaseline), "true")]
[DictionaryTranslateAttribute("ImagingOverallAssessment_Lugano", CriterionType.Lugano2014, nameof(OverallTumorEvaluationExport.IsBaseline), "false")]
[DictionaryTranslateAttribute("ExistDisease", CriterionType.Lugano2014WithoutPET, nameof(OverallTumorEvaluationExport.IsBaseline), "true")]
[DictionaryTranslateAttribute("ImagingOverallAssessment_Lugano", CriterionType.Lugano2014WithoutPET, nameof(OverallTumorEvaluationExport.IsBaseline), "false")]
[DictionaryTranslateAttribute("ExistDisease", CriterionType.IRECIST1Point1, nameof(OverallTumorEvaluationExport.IsBaseline), "true")]
[DictionaryTranslateAttribute("OverallAssessment", CriterionType.IRECIST1Point1, nameof(OverallTumorEvaluationExport.IsBaseline), "false")]
[DictionaryTranslateAttribute("ExistDisease", CriterionType.RECIST1Pointt1_MB, nameof(OverallTumorEvaluationExport.IsBaseline), "true")]
[DictionaryTranslateAttribute("OverallAssessment", CriterionType.RECIST1Pointt1_MB, nameof(OverallTumorEvaluationExport.IsBaseline), "false")]
[DictionaryTranslateAttribute("ExistDisease", CriterionType.RECIST1Point1, nameof(OverallTumorEvaluationExport.IsBaseline), "true")]
[DictionaryTranslateAttribute("OverallAssessment", CriterionType.RECIST1Point1, nameof(OverallTumorEvaluationExport.IsBaseline), "false")]
[DictionaryTranslateAttribute("VisitTumorEvaluation", CriterionType.PCWG3)]
//整体肿瘤评估结果 需要翻译
public string OverallTumorEvaluationResult { get; set; }
//裁判结果选择的访视或者全局任务Id
public Arm? JudgeArmEnum { get; set; }
//public Guid? JudgeResultTaskId { get; set; }
//裁判选择标记
//根据裁判的任务结果 设置访视任务的这个字段 该字段表示 裁判认同该任务的结果
[DictionaryTranslateAttribute("YesOrNo")]
public bool? IsGenerateJudge { get; set; }
public bool? IsJudgeSelect { get; set; }
//[JsonIgnore]
//在当前访视触发裁判,或者在截止日期小于等于当前访视的阅片期触发裁判
public bool IsTrigerJudge { get; set; }
//public List<GlobalAnswerInfo> GlobalTaskAnswerList { get; set; }
//(如果是访视点裁判,则仅在所选阅片人对应访视 显示;如果是阅片期裁判,则在所选阅片人 阅片期内的所有访视 显示此原因)
public string JudgeNote { get; set; } = string.Empty;
public string VisitNote { get; set; }
}
public class GlobalAnswerInfo
@ -1091,22 +1141,89 @@ namespace IRaCIS.Core.Application.Contracts
public class RECIST1Point1EvaluationOfTumorEfficacyExport : OverallTumorEvaluationExport
{
[DictionaryTranslateAttribute("TargetAssessment", CriterionType.RECIST1Pointt1_MB)]
[DictionaryTranslateAttribute("TargetAssessment", CriterionType.RECIST1Point1)]
// 靶病灶评估
public string TargetlesionEvaluationResult { get; set; }
[DictionaryTranslateAttribute("NoTargetAssessment", CriterionType.RECIST1Pointt1_MB)]
[DictionaryTranslateAttribute("NoTargetAssessment", CriterionType.RECIST1Point1)]
// 非靶病灶评估
public string NoneTargetlesionEvaluationResult { get; set; }
// 是否存在新病灶
[DictionaryTranslateAttribute("NewLesionAssessment", CriterionType.RECIST1Pointt1_MB)]
[DictionaryTranslateAttribute("NewLesionAssessment", CriterionType.RECIST1Point1)]
public string IsExistNewlesionEvaluationResult { get; set; }
}
public class Lugano2014EvaluationOfTumorEfficacyExport : OverallTumorEvaluationExport
{
[DictionaryTranslateAttribute("TargetAssessment", CriterionType.Lugano2014)]
public string TargetlesionEvaluationResult { get; set; }
[DictionaryTranslateAttribute("NoTargetAssessment", CriterionType.Lugano2014)]
public string NoneTargetlesionEvaluationResult { get; set; }
[DictionaryTranslateAttribute("NewLesionAssessment", CriterionType.Lugano2014)]
public string IsExistNewlesionEvaluationResult { get; set; }
//肝脏评估
[DictionaryTranslateAttribute("LiverState", CriterionType.Lugano2014)]
public string LiverResponse { get; set; }
//脾脏评估
[DictionaryTranslateAttribute("SpleenAssessment", CriterionType.Lugano2014)]
public string SpleenResponse { get; set; }
//CT/MRI总体评估
[DictionaryTranslateAttribute("CT-MRIOverallAssessment", CriterionType.Lugano2014)]
public string CT_MRI_OverallResponse { get; set; }
//FDG-PET总体评估
[DictionaryTranslateAttribute("FDG-PETOverallAssessment", CriterionType.Lugano2014)]
public string FDG_PET_OverallResponse { get; set; }
}
public class IRECIST1Point1EvaluationOfTumorEfficacyExport : OverallTumorEvaluationExport
{
[DictionaryTranslateAttribute("TargetAssessment", CriterionType.IRECIST1Point1)]
// 靶病灶评估
public string TargetlesionEvaluationResult { get; set; }
[DictionaryTranslateAttribute("NoTargetAssessment", CriterionType.IRECIST1Point1)]
// 非靶病灶评估
public string NoneTargetlesionEvaluationResult { get; set; }
// 是否存在新病灶
[DictionaryTranslateAttribute("NewLesionAssessment", CriterionType.IRECIST1Point1)]
public string IsExistNewlesionEvaluationResult { get; set; }
[DictionaryTranslateAttribute("NewLesionAssessment", CriterionType.IRECIST1Point1)]
public string NewTargetResponse { get; set; }
[DictionaryTranslateAttribute("NewLesionAssessment", CriterionType.IRECIST1Point1)]
public string NewNoneTargetResponse { get; set; }
[DictionaryTranslateAttribute("NewLesionAssessment", CriterionType.IRECIST1Point1)]
public string OtherPreviousNewlesionsResponse { get; set; }
//存在触发iRECIST后新病灶
[DictionaryTranslateAttribute("NewLesionAssessment", CriterionType.IRECIST1Point1)]
public string IsExistNewlesionsAfterTriggeringIRECIST { get; set; }
}
public class PCWG3LessionInfo
{
//病灶编号

View File

@ -18,6 +18,8 @@ namespace IRaCIS.Core.Application.Service
var isEn_Us = false;
CreateMap<Trial, ReadingPeriodJudgeExportInfo>();
CreateMap<Trial, VisitJudgeExportInfo>();
CreateMap<Trial, ExcelExportInfo>();
CreateMap<SubjectVisit, CRCVisitExportDTO>()
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
@ -193,38 +195,107 @@ namespace IRaCIS.Core.Application.Service
CreateMap<VisitTask, GroupAnalysisExport>().IncludeBase<VisitTask, AnalysisExortCommon>();
CreateMap<VisitTask, SelftAnalysisExport>().IncludeBase<VisitTask, AnalysisExortCommon>();
Guid trialReadingCriterionId = Guid.Empty;
ArbitrationRule? arbitrationRule = null;
CriterionType? criterionType = null;
CreateMap<VisitTask, OverallTumorEvaluationExport>()
// .ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName))
.ForMember(o => o.IsBaseline, t => t.MapFrom(u => u.SourceSubjectVisit.IsBaseLine))
.ForMember(o => o.JudgeArmEnum, t => t.MapFrom(u => u.JudgeResultTask.ArmEnum))
.ForMember(o => o.JudgeArmEnum, t => t.MapFrom(u => u.JudgeResultTask.ArmEnum))
.ForMember(o => o.IsTrigerJudge, t => t.MapFrom(u => arbitrationRule == ArbitrationRule.Visit ? u.JudgeResultTaskId != null :
(arbitrationRule == ArbitrationRule.Reading ?
u.Subject.SubjectVisitTaskList.Any(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Judge && t.TrialReadingCriterionId == trialReadingCriterionId && u.VisitTaskNum < t.VisitTaskNum) :
false)))
.ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.JudgeResultRemark))
.ForMember(o => o.VisitNote, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).FirstOrDefault()!.Answer))
.ForMember(o => o.OverallTumorEvaluationResult, t => t.MapFrom(u =>
criterionType == CriterionType.RECIST1Point1 ? (u.SourceSubjectVisit.IsBaseLine == true ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.ExistDisease).FirstOrDefault()!.Answer :
criterionType == CriterionType.PCWG3 ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstOrDefault()!.Answer :
(u.SourceSubjectVisit.IsBaseLine == true ?
u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.ExistDisease).FirstOrDefault()!.Answer :
u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).Select(t => t.IsGlobalChange ? t.GlobalChangeAnswer : t.Answer).FirstOrDefault())
: criterionType == CriterionType.PCWG3 ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstOrDefault()!.Answer : String.Empty
))
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
//.ForMember(o => o.GlobalTaskAnswerList, t => t.MapFrom(u => u.GlobalVisitResultList.Where(t=>t.GlobalAnswerType== GlobalAnswerType.Question).Select(c=>new GlobalAnswerInfo() { GlobalTaskVisitNum=c.VisitTask.VisitTaskNum,VisitTaskId=c.TaskId ,Answer=c.Answer})))
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName));
CreateMap<VisitTask, CommonEvaluationExport>()
.ForMember(o => o.IsBaseline, t => t.MapFrom(u => u.SourceSubjectVisit.IsBaseLine))
.ForMember(o => o.JudgeArmEnum, t => t.MapFrom(u => u.JudgeResultTask.ArmEnum))
.ForMember(o => o.IsTrigerJudge, t => t.MapFrom(u => arbitrationRule == ArbitrationRule.Visit ? u.JudgeResultTaskId != null :
(arbitrationRule == ArbitrationRule.Reading ?
u.Subject.SubjectVisitTaskList.Any(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Judge && t.TrialReadingCriterionId == trialReadingCriterionId && u.VisitTaskNum < t.VisitTaskNum) :
false)))
.ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.JudgeResultRemark))
.ForMember(o => o.VisitNote, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).FirstOrDefault()!.Answer))
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
.ForMember(o => o.JudgeQuestionAnswerList, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(k => k.ReadingQuestionTrial.ShowOrder)
.Select(c => new CommonQuesionInfo()
{
QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName,
QuestionValue = c.Answer,
TranslateDicName = c.ReadingQuestionTrial.DictionaryCode
})));
CreateMap<VisitTask, CommonEvaluationDetailExport>()
.ForMember(o => o.IsBaseline, t => t.MapFrom(u => u.SourceSubjectVisit.IsBaseLine))
.ForMember(o => o.JudgeArmEnum, t => t.MapFrom(u => u.JudgeResultTask.ArmEnum))
.ForMember(o => o.IsTrigerJudge, t => t.MapFrom(u => arbitrationRule == ArbitrationRule.Visit ? u.JudgeResultTaskId != null :
(arbitrationRule == ArbitrationRule.Reading ?
u.Subject.SubjectVisitTaskList.Any(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Judge && t.TrialReadingCriterionId == trialReadingCriterionId && u.VisitTaskNum < t.VisitTaskNum) :
false)))
.ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.JudgeResultRemark))
.ForMember(o => o.VisitNote, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).FirstOrDefault()!.Answer))
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
.ForMember(o => o.QuestionAnswerList, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(k => k.ReadingQuestionTrial.ShowOrder)
.Select(c => new CommonQuesionInfo()
{
QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName,
QuestionValue = c.Answer,
TranslateDicName = c.ReadingQuestionTrial.DictionaryCode
})));
;
CreateMap<VisitTask, RECIST1Point1EvaluationOfTumorEfficacyExport>().IncludeBase<VisitTask, OverallTumorEvaluationExport>()
.ForMember(o => o.TargetlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.NoneTargetlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.NoTargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.IsExistNewlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.NewLesions).FirstOrDefault()!.Answer))
//.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
//.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code))
//.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
;
CreateMap<VisitTask, IRECIST1Point1EvaluationOfTumorEfficacyExport>().IncludeBase<VisitTask, OverallTumorEvaluationExport>()
.ForMember(o => o.TargetlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.NoneTargetlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.NoTargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.IsExistNewlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.NewLesions).FirstOrDefault()!.Answer))
.ForMember(o => o.NewTargetResponse, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.NewTargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.NewNoneTargetResponse, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.NewNoTargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.OtherPreviousNewlesionsResponse, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.OtherNewTargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.IsExistNewlesionsAfterTriggeringIRECIST, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.IRECISTNewTargetLesion).FirstOrDefault()!.Answer))
;
CreateMap<VisitTask, Lugano2014EvaluationOfTumorEfficacyExport>().IncludeBase<VisitTask, OverallTumorEvaluationExport>()
.ForMember(o => o.TargetlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.NoneTargetlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.NoTargetLesion).FirstOrDefault()!.Answer))
.ForMember(o => o.IsExistNewlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.NewLesions).FirstOrDefault()!.Answer))
.ForMember(o => o.LiverResponse, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.LiverAssessment).FirstOrDefault()!.Answer))
.ForMember(o => o.SpleenResponse, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.SplenicEvaluation).FirstOrDefault()!.Answer))
.ForMember(o => o.CT_MRI_OverallResponse, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.CTandMRI).FirstOrDefault()!.Answer))
.ForMember(o => o.FDG_PET_OverallResponse, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.FDGPET).FirstOrDefault()!.Answer))
;
CreateMap<VisitTask, RECIST1Point1DetailedOfEvaluatedLesionExport>().IncludeBase<VisitTask, RECIST1Point1EvaluationOfTumorEfficacyExport>()

View File

@ -159,6 +159,34 @@ namespace IRaCIS.Application.Contracts
public bool IsEnglish { get; set; }
}
public class VisitJudgeExportInfo: ExcelExportInfo
{
public int VisitCount { get; set; }
public int JudgeVisitCount { get; set; }
public string JudgeRatioStr => VisitCount == 0 ? $"NA" : $"{Math.Round((decimal)JudgeVisitCount * 100 / VisitCount, 2)}%";
}
public class ReadingPeriodJudgeExportInfo : ExcelExportInfo
{
public int SubjectCount { get; set; }
public int judgeSubjectCount { get; set; }
public string SubjectJudgeRatioStr => SubjectCount == 0 ? $"NA" : $"{Math.Round((decimal)judgeSubjectCount * 100 / SubjectCount, 2)}%";
public int ReadingPeriodCount { get; set; }
public int judgeReadingPeriodCount { get; set; }
public string ReadingPeriodJudgeRatioStr => ReadingPeriodCount == 0 ? $"NA" : $"{Math.Round((decimal)judgeReadingPeriodCount * 100 / ReadingPeriodCount, 2)}%";
public List<DoctorJudgeRatio> DoctorPeriodStatList { get; set; }
public List<DoctorJudgeRatio> DoctorSubjectStatList { get; set; }
}
public class ExcelExportInfo : TrialSelectDTO

View File

@ -193,7 +193,8 @@ public class VisitTask : BaseFullAuditEntity
[Comment("PM 对该任务进行了回退 影响的任务不设置")]
public bool IsPMSetBack { get; set; }
[Comment("裁判结果的任务ID")]
[Comment("裁判结果的任务ID访视或者全局")]
public Guid? JudgeResultTaskId { get; set; }
[Comment("随访任务号 取访视的号 计划外是 访视+0.1 裁判任务在访视任务上+0.002 全局任务在截止访视号上+0.03 肿瘤待定")]
public decimal VisitTaskNum { get; set; }

View File

@ -270,13 +270,26 @@ public static class StaticData
public const string OverallTumorEvaluation_Export = "OverallTumorEvaluation_Export";
public const string IRECIST1Point1EvaluationOfTumorEfficacy_Export = "IRECIST1Point1EvaluationOfTumorEfficacy_Export";
public const string RECIST1Point1EvaluationOfTumorEfficacy_Export = "RECIST1Point1EvaluationOfTumorEfficacy_Export";
public const string Lugano2014EvaluationOfTumorEfficacy_Export = "Lugano2014EvaluationOfTumorEfficacy_Export";
public const string RECIST1Point1DetailedOfEvaluatedLesion_Export = "RECIST1Point1DetailedOfEvaluatedLesion_Export";
public const string PCWG3Point1DetailedOfEvaluatedLesion_Export = "PCWG3Point1DetailedOfEvaluatedLesion_Export";
public const string CommonReading_Export = "CommonReading_Export";
public const string CommonReadingDetail_Export = "CommonReadingDetail_Export";
public const string CommonJudgeReadingDetail_Export = "CommonJudgeReadingDetail_Export";
public const string VisitJudgeRatio_Export = "VisitJudgeRatio_Export";
public const string ReadingPeriodJudgeRatio_Export = "ReadingPeriodJudgeRatio_Export";
public const string IVUSTheMeasuredValueOfEachMatchedFragment = "IVUS_TheMeasuredValueOfEachMatchedFragment";