分裂修改

IRC_NewDev
he 2024-02-28 14:52:49 +08:00
parent f26aafa8cb
commit 4f978863e4
4 changed files with 173 additions and 5 deletions

View File

@ -4881,6 +4881,56 @@
序号标记
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.QuestionMark">
<summary>
问题标识
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.QuestionId">
<summary>
问题Id
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.TableQuestionId">
<summary>
表格问题Id
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.VisitTaskId">
<summary>
任务Id
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.TrialId">
<summary>
项目Id
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.RowIndex">
<summary>
行号
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.Answer">
<summary>
答案
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.CreateUserId">
<summary>
创建人
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.TableQuestionAnswerInfo.RowId">
<summary>
RowId
</summary>
</member>
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.MergeLesionInDto.MergeMainRowId">
<summary>
融合的主病灶

View File

@ -317,6 +317,72 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid RowId { get; set; }
}
public class TableQuestionAnswerInfo
{
public Guid Id { get; set; }
/// <summary>
/// 问题标识
/// </summary>
public QuestionMark? QuestionMark { get; set; }
/// <summary>
/// 问题Id
/// </summary>
public Guid QuestionId { get; set; }
/// <summary>
/// 表格问题Id
/// </summary>
public Guid TableQuestionId { get; set; }
/// <summary>
/// 任务Id
/// </summary>
public Guid VisitTaskId { get; set; }
/// <summary>
/// 项目Id
/// </summary>
public Guid TrialId { get; set; }
/// <summary>
/// 行号
/// </summary>
public decimal RowIndex { get; set; }
/// <summary>
/// 答案
/// </summary>
public string Answer { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public Guid CreateUserId { get; set; }
/// <summary>
/// RowId
/// </summary>
public Guid RowId { get; set; }
public Guid UpdateUserId { get; set; }
public DateTime UpdateTime { get; set; }
public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; }
public Guid? DeleteUserId { get; set; }
}
public class MergeLesionInDto
{
public Guid VisitTaskId { get; set; }

View File

@ -18,6 +18,8 @@ using DocumentFormat.OpenXml.Drawing;
using EasyCaching.Core;
using DocumentFormat.OpenXml.Drawing.Charts;
using IRaCIS.Core.Application.Service.ReadingCalculate.Interface;
using AutoMapper.QueryableExtensions;
using IRaCIS.Application.Contracts;
namespace IRaCIS.Application.Services
{
@ -1411,8 +1413,9 @@ namespace IRaCIS.Application.Services
{
await VerifyTaskIsSign(inDto.VisitTaskId);
await this.VerifyIsBaseLineTask(inDto.VisitTaskId);
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
var rowAnswer = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).AsNoTracking().FirstNotNullAsync();
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == rowAnswer.RowIndex && x.QuestionId == inDto.QuestionId).Include(x => x.ReadingTableQuestionTrial).ToListAsync();
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == rowAnswer.RowIndex && x.QuestionId == inDto.QuestionId).Include(x => x.ReadingTableQuestionTrial).ProjectTo<TableQuestionAnswerInfo>(_mapper.ConfigurationProvider).ToListAsync();
var maxRowIndex = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.RowIndex < Math.Floor(rowAnswer.RowIndex + 1)).OrderByDescending(x => x.RowIndex).Select(x => x.RowIndex).FirstOrDefaultAsync();
var newRowIndex = maxRowIndex + (decimal)0.01;
@ -1444,11 +1447,57 @@ namespace IRaCIS.Application.Services
x.RowIndex = newRowIndex;
x.VisitTaskId = inDto.VisitTaskId;
x.RowId = rowAnswer.Id;
x.Answer = needSaveMark.Contains(x.ReadingTableQuestionTrial.QuestionMark) ? x.Answer : string.Empty;
x.ReadingTableQuestionTrial = null;
x.Answer = needSaveMark.Contains(x.QuestionMark) ? x.Answer : string.Empty;
});
switch (taskInfo.TrialReadingCriterion.CriterionType)
{
case CriterionType.Lugano2014:
List<QuestionMark?> needSetNa = new List<QuestionMark?>()
{
QuestionMark.LowPPDAddPercent,
QuestionMark.NadirPPD,
/// <summary>
/// PPD最低点所在访视
/// </summary>
QuestionMark.LowPPDVisit ,
/// <summary>
/// PPD最低点LDi
/// </summary>
QuestionMark.LowPPDLDi,
/// <summary>
/// PPD最低点SDi
/// </summary>
QuestionMark.LowPPDSDi,
/// <summary>
/// 相比最低点PPD增加百分比
/// </summary>
QuestionMark.LowPPDAddPercent,
/// <summary>
/// 相比PPD最低点LDi增加值
/// </summary>
QuestionMark.LowPPDLDiAdded,
/// <summary>
/// 相比PPD最低点SDi增加值
/// </summary>
QuestionMark.LowPPDSDiAdded,
};
tableAnswers.ForEach(x =>
{
x.Answer = needSetNa.Contains(x.QuestionMark) ?"NA" :x.Answer;
});
break;
}
await _readingTableAnswerRowInfoRepository.AddAsync(rowAnswer);
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
await _readingTableQuestionAnswerRepository.AddRangeAsync(_mapper.Map<List<ReadingTableQuestionAnswer>>(tableAnswers));
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.RowId, x => new ReadingTableAnswerRowInfo()
{
SplitOrMergeType = SplitOrMergeType.SplitMain

View File

@ -69,8 +69,11 @@ namespace IRaCIS.Core.Application.Service
CreateMap<UserWLTemplate,UserWLTemplateAddOrEdit>().ReverseMap();
CreateMap<ReadingPeriodSetAddOrEdit, ReadingPeriodSet>();
CreateMap<ReadingTableQuestionAnswer, TableQuestionAnswerInfo>().ReverseMap();
CreateMap<ReadingTableQuestionAnswer, TableQuestionAnswerInfo>()
.ForMember(d => d.QuestionMark, u => u.MapFrom(s => s.ReadingTableQuestionTrial == null ? null : s.ReadingTableQuestionTrial.QuestionMark));
CreateMap<AddOrUpdateTumorAssessmentInDto, TumorAssessment_RECIST1Point1>();
CreateMap<AddOrUpdateTumorAssessmentInDto, TumorAssessment_RECIST1Point1>();
CreateMap<ReadingPeriodSet, ReadingPeriodSetView>()
.ForMember(d => d.SubjectVisitName, u => u.MapFrom(s => s.VisitStage==null?string.Empty: s.VisitStage.VisitName))