修改导表备注

IRC_NewDev
hang 2024-10-22 14:38:18 +08:00
parent 773c657b67
commit 6eddf7e2a1
5 changed files with 193 additions and 94 deletions

View File

@ -829,13 +829,6 @@
<param name="_trialRepository"></param> <param name="_trialRepository"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialReadingCriterionCanExportDocumentList(System.Guid)">
<summary>
获取阅片标准可以导出的列表
</summary>
<param name="trialReadingCriterionId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonJudgeEvaluationList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})"> <member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonJudgeEvaluationList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary> <summary>
裁判阅片明细表 裁判阅片明细表
@ -846,6 +839,34 @@
<param name="_trialRepository"></param> <param name="_trialRepository"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialReadingCriterionCanExportDocumentList(System.Guid)">
<summary>
获取阅片标准可以导出的列表
</summary>
<param name="trialReadingCriterionId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonEvaluationList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
通用阅片结果、阅片结果明细,裁判明细表导出,条件通过 ReadingExportType 012区分
</summary>
<param name="inQuery"></param>
<param name="_commonDocumentRepository"></param>
<param name="_dictionaryService"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonJudgeRatioList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
裁判一致率导出
</summary>
<param name="inQuery"></param>
<param name="_commonDocumentRepository"></param>
<param name="_dictionaryService"></param>
<param name="_trialRepository"></param>
<returns></returns>
<exception cref="T:System.Exception"></exception>
</member>
<member name="T:IRaCIS.Core.Application.Service.DictionaryService"> <member name="T:IRaCIS.Core.Application.Service.DictionaryService">
<summary> <summary>
数据字典-基础数据维护 数据字典-基础数据维护
@ -1185,6 +1206,20 @@
<param name="Id"></param> <param name="Id"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.UpdatePaymentMode(IRaCIS.Application.Contracts.PaymentModeDto)">
<summary>
修改支付方式
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.GetPaymentMode(System.Guid)">
<summary>
获取支付方式
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.GetBasicInfo(System.Guid)"> <member name="M:IRaCIS.Core.Application.Service.DoctorService.GetBasicInfo(System.Guid)">
<summary> <summary>
详情、编辑-获取 医生基本信息 BasicInfo 详情、编辑-获取 医生基本信息 BasicInfo
@ -16835,6 +16870,31 @@
工作兼职En 工作兼职En
</summary> </summary>
</member> </member>
<member name="P:IRaCIS.Application.Contracts.PaymentModeDto.BankNum">
<summary>
银行卡号
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.PaymentModeDto.BankName">
<summary>
银行名称
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.PaymentModeDto.OpeningBank">
<summary>
开户行
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.PaymentModeDto.IdCard">
<summary>
身份证号
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.PaymentModeDto.BankPhoneNum">
<summary>
银行手机号
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.Summarize"> <member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.Summarize">
<summary> <summary>
概述 概述
@ -17103,6 +17163,13 @@
<param name="doctorId"></param> <param name="doctorId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Application.Interfaces.IDoctorService.GetPaymentMode(System.Guid)">
<summary>
获取支付信息
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Interfaces.IDoctorService.GetSummarizeInfo(System.Guid)"> <member name="M:IRaCIS.Application.Interfaces.IDoctorService.GetSummarizeInfo(System.Guid)">
<summary> <summary>
获取概述 获取概述

View File

@ -464,7 +464,7 @@ namespace IRaCIS.Core.Application.ViewModel
public string? RequestReReadingReason { get; set; } public string? RequestReReadingReason { get; set; }
public ReadingExportType? ReadingExportType { get; set; } public ReadingExportType ReadingExportType { get; set; }
} }

View File

@ -1,4 +1,5 @@
using IRaCIS.Application.Contracts; using DocumentFormat.OpenXml.Spreadsheet;
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Interfaces; using IRaCIS.Application.Interfaces;
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson; using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts;
@ -1996,6 +1997,73 @@ namespace IRaCIS.Core.Application.Service.Common
#endregion #endregion
#region 通用阅片结果导出 #region 通用阅片结果导出
/// <summary>
/// 裁判阅片明细表
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_commonDocumentRepository"></param>
/// <param name="_dictionaryService"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost]
[Obsolete]
public async Task<IActionResult> GetCommonJudgeEvaluationList_Export(VisitTaskQuery inQuery,
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
[FromServices] IDictionaryService _dictionaryService,
[FromServices] IRepository<Trial> _trialRepository)
{
//每次查询必须是单标准的
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect)
//访视和全局查询已签名完成的,裁判可以是未签名,未完成的
.Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Judge))
//.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
//.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
//.WhereIf(inQuery.IsSelfAnalysis != null, t => t.IsSelfAnalysis == inQuery.IsSelfAnalysis)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId, isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
exportInfo.CriterionName = criterion.CriterionName;
//处理裁判标记
list = DealJudgeMark(criterion.ArbitrationRule, list);
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
var dynamicColumnConfig = new DynamicColumnConfig() { AutoColumnTitleRowIndex = 2, AutoColumnStartIndex = 6, ColumnNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.QuestionName).ToList() };
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(StaticData.Export.CommonJudgeReadingDetail_Export, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
{
FileDownloadName = $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}_{fileName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
};
}
/// <summary> /// <summary>
/// 获取阅片标准可以导出的列表 /// 获取阅片标准可以导出的列表
/// </summary> /// </summary>
@ -2065,6 +2133,15 @@ namespace IRaCIS.Core.Application.Service.Common
} }
return list; return list;
} }
/// <summary>
/// 通用阅片结果、阅片结果明细,裁判明细表导出,条件通过 ReadingExportType 012区分
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_commonDocumentRepository"></param>
/// <param name="_dictionaryService"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost] [HttpPost]
public async Task<IActionResult> GetCommonEvaluationList_Export(VisitTaskQuery inQuery, public async Task<IActionResult> GetCommonEvaluationList_Export(VisitTaskQuery inQuery,
[FromServices] IRepository<CommonDocument> _commonDocumentRepository, [FromServices] IRepository<CommonDocument> _commonDocumentRepository,
@ -2075,28 +2152,24 @@ namespace IRaCIS.Core.Application.Service.Common
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync(); var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect && t.TaskState == TaskState.Freeze)) var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
//访视和全局查询已签名完成的,裁判可以是未签名,未完成的
.Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Judge))
//.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
//.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
//.WhereIf(inQuery.IsSelfAnalysis != null, t => t.IsSelfAnalysis == inQuery.IsSelfAnalysis)
//访视和全局查询已签名完成的,裁判可以是未签名,未完成的
.Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || t.ReadingCategory == ReadingCategory.Judge)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) .WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent) .WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId) .WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory) .WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState) //.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState) .WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum) .WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false)) .WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName)) .WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate) .WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1)) .WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider, new { readingExportType = inQuery.ReadingExportType, criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId, isEn_Us = _userInfo.IsEn_Us }).ToListAsync(); .ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider, new { readingExportType = inQuery.ReadingExportType, criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId, isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList(); list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
@ -2127,23 +2200,31 @@ namespace IRaCIS.Core.Application.Service.Common
#region 系统标准处理整体肿瘤评估合并 #region 系统标准处理整体肿瘤评估合并
var translateDicNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.TranslateDicName).ToList();
//针对1.1 整体肿瘤评估 有的两列要合并一列 //针对1.1 整体肿瘤评估 有的两列要合并一列
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB || criterion.CriterionType == CriterionType.IRECIST1Point1) if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB || criterion.CriterionType == CriterionType.IRECIST1Point1)
{ {
foreach (var item in list) foreach (var item in list)
{ {
var removeList = item.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.ExistDisease || t.QuestionType == QuestionType.Tumor).ToList(); //处理合并表头
if (list.IndexOf(item) == 0)
{
var questionType = item.IsBaseline == true ? QuestionType.ExistDisease : QuestionType.Tumor;
var findItem = item.QuestionAnswerList.Where(t => t.QuestionType == questionType).FirstOrDefault();
findItem.QuestionName = _userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估";
}
if (item.IsBaseline == true) if (item.IsBaseline == true)
{ {
item.OverallTumorEvaluationResult = removeList.Where(t => t.QuestionType == QuestionType.ExistDisease).FirstOrDefault()?.QuestionValue; item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.Tumor).ToList();
} }
else else
{ {
item.OverallTumorEvaluationResult = removeList.Where(t => t.QuestionType != QuestionType.ExistDisease).FirstOrDefault()?.QuestionValue; item.QuestionAnswerList = item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ExistDisease).ToList();
} }
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => !(t.QuestionType == QuestionType.ExistDisease || t.QuestionType == QuestionType.Tumor)).ToList();
} }
} }
else if (criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET) else if (criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
@ -2151,18 +2232,24 @@ namespace IRaCIS.Core.Application.Service.Common
foreach (var item in list) foreach (var item in list)
{ {
var removeList = item.QuestionAnswerList.Where(t => t.QuestionType == QuestionType.ExistDisease || t.QuestionType == QuestionType.ImgOncology).ToList(); //处理合并表头
if (list.IndexOf(item) == 0)
{
var questionType = item.IsBaseline == true ? QuestionType.ExistDisease : QuestionType.ImgOncology;
var findItem = item.QuestionAnswerList.Where(t => t.QuestionType == questionType).FirstOrDefault();
findItem.QuestionName = _userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估";
}
if (item.IsBaseline == true) if (item.IsBaseline == true)
{ {
item.OverallTumorEvaluationResult = removeList.Where(t => t.QuestionType == QuestionType.ExistDisease).FirstOrDefault()?.QuestionValue; item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ImgOncology).ToList();
} }
else else
{ {
item.OverallTumorEvaluationResult = removeList.Where(t => t.QuestionType != QuestionType.ExistDisease).FirstOrDefault()?.QuestionValue; item.QuestionAnswerList = item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ExistDisease).ToList();
} }
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => !(t.QuestionType == QuestionType.ExistDisease || t.QuestionType == QuestionType.ImgOncology)).ToList();
} }
} }
else if (criterion.CriterionType == CriterionType.PCWG3) else if (criterion.CriterionType == CriterionType.PCWG3)
@ -2188,7 +2275,7 @@ namespace IRaCIS.Core.Application.Service.Common
DynamicListName = "QuestionAnswerList", DynamicListName = "QuestionAnswerList",
RemoveColunmIndexList = new List<int>() { }, RemoveColunmIndexList = new List<int>() { },
ColumnNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.QuestionName).ToList() ?? new List<string>(), ColumnNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.QuestionName).ToList() ?? new List<string>(),
TranslateDicNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.TranslateDicName).ToList() ?? new List<string>() TranslateDicNameList = translateDicNameList ?? new List<string>()
}; };
@ -2205,74 +2292,18 @@ namespace IRaCIS.Core.Application.Service.Common
}; };
} }
/// <summary> /// <summary>
/// 裁判阅片明细表 /// 裁判一致率导出
/// </summary> /// </summary>
/// <param name="inQuery"></param> /// <param name="inQuery"></param>
/// <param name="_commonDocumentRepository"></param> /// <param name="_commonDocumentRepository"></param>
/// <param name="_dictionaryService"></param> /// <param name="_dictionaryService"></param>
/// <param name="_trialRepository"></param> /// <param name="_trialRepository"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] /// <exception cref="Exception"></exception>
public async Task<IActionResult> GetCommonJudgeEvaluationList_Export(VisitTaskQuery inQuery,
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
[FromServices] IDictionaryService _dictionaryService,
[FromServices] IRepository<Trial> _trialRepository)
{
//每次查询必须是单标准的
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect)
//访视和全局查询已签名完成的,裁判可以是未签名,未完成的
.Where(t => (t.ReadingTaskState == ReadingTaskState.HaveSigned && (t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)) || (t.ReadingCategory == ReadingCategory.Judge))
//.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
//.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
//.WhereIf(inQuery.IsSelfAnalysis != null, t => t.IsSelfAnalysis == inQuery.IsSelfAnalysis)
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.WhereIf(inQuery.DoctorUserId != null, t => t.DoctorUserId == inQuery.DoctorUserId)
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider, new { criterionType = criterion.CriterionType, arbitrationRule = criterion.ArbitrationRule, trialReadingCriterionId = inQuery.TrialReadingCriterionId, isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
list = list.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum).ToList();
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
exportInfo.CriterionName = criterion.CriterionName;
//处理裁判标记
list = DealJudgeMark(criterion.ArbitrationRule, list);
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId);
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
var dynamicColumnConfig = new DynamicColumnConfig() { AutoColumnTitleRowIndex = 2, AutoColumnStartIndex = 6, ColumnNameList = list.FirstOrDefault()?.QuestionAnswerList.Select(t => t.QuestionName).ToList() };
var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(StaticData.Export.CommonJudgeReadingDetail_Export, exportInfo, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CommonEvaluationExport), criterion.CriterionType, dynamicColumnConfig);
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
{
FileDownloadName = $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}_{fileName}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
};
}
[HttpPost] [HttpPost]
public async Task<IActionResult> GetCommonJudgeRatioList_Export(VisitTaskQuery inQuery, public async Task<IActionResult> GetCommonJudgeRatioList_Export(VisitTaskQuery inQuery,
[FromServices] IRepository<CommonDocument> _commonDocumentRepository, [FromServices] IRepository<CommonDocument> _commonDocumentRepository,

View File

@ -1103,7 +1103,7 @@ namespace IRaCIS.Core.Application.Contracts
public Guid Id { get; set; } public Guid Id { get; set; }
public Guid DoctorUserId { get; set; } public Guid? DoctorUserId { get; set; }
public string TaskName { get; set; } public string TaskName { get; set; }
public string TaskBlindName { get; set; } public string TaskBlindName { get; set; }

View File

@ -243,7 +243,7 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)) .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
.ForMember(o => o.QuestionAnswerList, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList .ForMember(o => o.QuestionAnswerList, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList
.Where(c => readingExportType == ReadingExportType.ReadingResult ? .Where(c => readingExportType == ReadingExportType.ReadingResult ?
c.ReadingQuestionTrial.ExportResultStr.Contains( ((int)ExportResult.TableOfAssessmentResults).ToString()) : c.ReadingQuestionTrial.ExportResultStr.Contains(((int)ExportResult.TableOfAssessmentResults).ToString()) :
(readingExportType == ReadingExportType.ReadingDetailResult ? c.ReadingQuestionTrial.ExportResultStr.Contains(((int)ExportResult.DetailedTableOfAssessmentResults).ToString()) : (readingExportType == ReadingExportType.ReadingDetailResult ? c.ReadingQuestionTrial.ExportResultStr.Contains(((int)ExportResult.DetailedTableOfAssessmentResults).ToString()) :
c.ReadingQuestionTrial.ExportResultStr.Contains(((int)ExportResult.DetailedTableOfAdjudicationResults).ToString()))) c.ReadingQuestionTrial.ExportResultStr.Contains(((int)ExportResult.DetailedTableOfAdjudicationResults).ToString())))
.OrderBy(k => k.ReadingQuestionTrial.ShowOrder) .OrderBy(k => k.ReadingQuestionTrial.ShowOrder)
@ -253,7 +253,8 @@ namespace IRaCIS.Core.Application.Service
QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName, QuestionName = isEn_Us ? c.ReadingQuestionTrial.QuestionEnName : c.ReadingQuestionTrial.QuestionName,
QuestionValue = c.Answer, QuestionValue = c.Answer,
TranslateDicName = c.ReadingQuestionTrial.DictionaryCode TranslateDicName = c.ReadingQuestionTrial.DictionaryCode
}))); })))
;
CreateMap<VisitTask, RECIST1Point1EvaluationOfTumorEfficacyExport>().IncludeBase<VisitTask, OverallTumorEvaluationExport>() CreateMap<VisitTask, RECIST1Point1EvaluationOfTumorEfficacyExport>().IncludeBase<VisitTask, OverallTumorEvaluationExport>()