肿瘤学阅片结果导出
parent
131425774a
commit
faea3a4f86
|
@ -933,7 +933,7 @@
|
|||
<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.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<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.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
阅片结果表、阅片结果明细,评估病灶明细表, 裁判明细表导出,条件通过 ReadingExportType ( 1,2,3,4)区分
|
||||
</summary>
|
||||
|
|
|
@ -4,6 +4,7 @@ using IRaCIS.Application.Interfaces;
|
|||
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts.DTO;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
@ -1613,8 +1614,52 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
}
|
||||
|
||||
public List<T> DealOncologyResult<T>(IRepository<ReadingOncologyTaskInfo> _oncologyRepository, bool isOncology, List<T> list) where T : CommonEvaluationExport
|
||||
{
|
||||
if (isOncology)
|
||||
{
|
||||
|
||||
var subjectIdList = list.Select(t => t.SubjectId).Distinct().ToList();
|
||||
|
||||
//已阅片完的肿瘤学结果
|
||||
var oncologyResultList = _oncologyRepository.Where(t => subjectIdList.Contains(t.OncologyVisitTask.SubjectId)
|
||||
&& t.OncologyVisitTask.IsAnalysisCreate == false && t.OncologyVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.OncologyVisitTask.TaskState == TaskState.Effect)
|
||||
|
||||
.Select(t => new { t.OncologyVisitTask.SubjectId, OncologyVisitTaskNum = t.OncologyVisitTask.VisitTaskNum, OncologyUserName = t.OncologyVisitTask.DoctorUser.UserName, t.VisitTask.VisitTaskNum, t.VisitTaskId, t.EvaluationReason, t.EvaluationResult })
|
||||
.ToList();
|
||||
|
||||
foreach (var subjectOncologyResult in oncologyResultList.GroupBy(t => t.SubjectId))
|
||||
{
|
||||
//最后已完成的肿瘤学任务号
|
||||
var lastOncologyVisitTaskNum = subjectOncologyResult.OrderByDescending(t => t.OncologyVisitTaskNum).FirstOrDefault().OncologyVisitTaskNum;
|
||||
|
||||
//需要填充的肿瘤学结果
|
||||
var subjectOncologyList = subjectOncologyResult.Where(t => t.OncologyVisitTaskNum == lastOncologyVisitTaskNum).ToList();
|
||||
|
||||
|
||||
foreach (var subjectOncology in subjectOncologyList)
|
||||
{
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item.SubjectId == subjectOncology.SubjectId && item.VisitTaskNum == subjectOncology.VisitTaskNum)
|
||||
{
|
||||
item.OncologyReason = subjectOncology.EvaluationReason;
|
||||
item.OncologyResult = subjectOncology.EvaluationResult;
|
||||
item.OncologyUserName = subjectOncology.OncologyUserName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
public List<T> DealJudgeMark<T>(ArbitrationRule arbitrationRule, bool isGlobalReading, IEnumerable<T> list) where T : CommonEvaluationExport
|
||||
{
|
||||
//处理访视任务的裁判标记
|
||||
|
@ -2172,12 +2217,13 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<ReadingQuestionTrial> _trialReadingQuestionRepository,
|
||||
[FromServices] IRepository<ReadingTableQuestionTrial> _trialReadingTableQuestionRepository,
|
||||
[FromServices] IRepository<ReadingOncologyTaskInfo> _oncologyRepository,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var trialId = inQuery.TrialId;
|
||||
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
|
||||
//每次查询必须是单标准的
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionGroup, t.IsGlobalReading, t.IsArbitrationReading, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionGroup, t.IsGlobalReading, t.IsArbitrationReading, t.IsOncologyReading, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync();
|
||||
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||
|
@ -2218,6 +2264,16 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//仲裁阅片 才有裁判阅片明细表 同时要把模板里面的三列给去掉
|
||||
removeColumnIndexList = new List<int>() { 6, 7, 8 };
|
||||
}
|
||||
|
||||
//阅片结果表 和阅片结果明细表 没有肿瘤学的时候需要移除肿瘤学三个字段
|
||||
|
||||
if (!criterion.IsOncologyReading)
|
||||
{
|
||||
if (inQuery.ReadingExportType == ExportResult.TableOfAssessmentResults || inQuery.ReadingExportType == ExportResult.DetailedTableOfAssessmentResults)
|
||||
{
|
||||
removeColumnIndexList = removeColumnIndexList.Union(new List<int>() { 9, 10, 11 }).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var export_Template = StaticData.Export.CommonReading_Export;
|
||||
|
@ -2636,7 +2692,7 @@ 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, QuestionName = t.TableName + "_" + t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode });
|
||||
|
||||
//有三部分组成 外层问题+ 固定列表格名称 + 动态的表格问题
|
||||
dynamicLessionInfoList = item.QuestionAnswerList.Union(addLessionInfoList).Union(dynamicPartialLessionInfoList).ToList();
|
||||
|
@ -2678,7 +2734,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
{
|
||||
AutoColumnTitleRowIndex = 2,
|
||||
AutoColumnStartIndex = 6,
|
||||
TempalteLastColumnIndex = 8,
|
||||
TempalteLastColumnIndex = 11,
|
||||
DynamicItemDicName = "TranslateDicName",
|
||||
DynamicItemValueName = "QuestionValue",
|
||||
DynamicItemTitleName = "QuestionName",
|
||||
|
@ -2731,7 +2787,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
#region 最终导出参数处理
|
||||
|
||||
if (inQuery.ReadingExportType == ExportResult.DetailedTableOfAdjudicationResults)
|
||||
//裁判阅片明细表
|
||||
if (export_Template == StaticData.Export.CommonJudgeReadingDetail_Export)
|
||||
{
|
||||
//R1 R2 两个人的访视都阅片完成了才可以,去除只有一个人阅片完成的访视
|
||||
//找到只有一个人阅片的受试者 和访视
|
||||
|
@ -2747,7 +2804,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
//处理裁判标记
|
||||
list = DealJudgeMark(criterion.ArbitrationRule, criterion.IsGlobalReading, list);
|
||||
|
||||
//裁判阅片明细表
|
||||
//处理肿瘤学结果
|
||||
list = DealOncologyResult(_oncologyRepository, criterion.IsOncologyReading, list);
|
||||
|
||||
//裁判阅片明细表 处理完标记后处理
|
||||
if (export_Template == StaticData.Export.CommonJudgeReadingDetail_Export)
|
||||
{
|
||||
//裁判产生标记为空的数据过滤掉
|
||||
|
|
|
@ -1216,6 +1216,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid? DoctorUserId { get; set; }
|
||||
|
||||
public string TaskName { get; set; }
|
||||
|
@ -1270,6 +1272,17 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public DateTime? SignTime { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region 肿瘤学结果
|
||||
|
||||
[DictionaryTranslateAttribute("OncologyAssessType")]
|
||||
public string OncologyResult { get; set; } = string.Empty;
|
||||
|
||||
public string OncologyReason { get; set; } = string.Empty;
|
||||
|
||||
public string OncologyUserName { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class CommonLessionExport : CommonEvaluationExport
|
||||
|
|
Loading…
Reference in New Issue