修改疗效评估

Uat_Study
hang 2022-09-20 15:16:47 +08:00
parent ad78362f93
commit 528a8dbf6e
4 changed files with 152 additions and 290 deletions

View File

@ -8,40 +8,22 @@ using System.Threading.Tasks;
namespace IRaCIS.Core.Application.Service.Reading.Dto namespace IRaCIS.Core.Application.Service.Reading.Dto
{ {
public class TumorAssessmentView: AddOrUpdateTumorAssessmentInDto
{
}
public class AddOrUpdateTumorAssessmentInDto public class AddOrUpdateTumorAssessmentInDto
{ {
public Guid? Id { get; set; } public Guid? Id { get; set; }
/// <summary>
/// 靶病灶
/// </summary>
public string TargetLesion { get; set; }
/// <summary>
/// 非靶病灶
/// </summary>
public string NonTargetLesions { get; set; }
/// <summary>
/// 新病灶
/// </summary>
public string NewLesion { get; set; }
/// <summary>
/// 整体疗效
/// </summary>
public string OverallEfficacy { get; set; }
/// <summary> /// <summary>
/// 标准ID /// 标准ID
/// </summary> /// </summary>
public Guid CriterionId { get; set; } public Guid CriterionId { get; set; }
}
public class GetTumorAssessmentListInDto
{
public Guid CriterionId { get; set; }
/// <summary> /// <summary>
/// 靶病灶 /// 靶病灶
@ -62,6 +44,32 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 整体疗效 /// 整体疗效
/// </summary> /// </summary>
public OverallAssessment OverallEfficacy { get; set; } public OverallAssessment OverallEfficacy { get; set; }
}
public class GetTumorAssessmentListInDto
{
public Guid CriterionId { get; set; }
/// <summary>
/// 靶病灶
/// </summary>
public TargetAssessment? TargetLesion { get; set; }
/// <summary>
/// 非靶病灶
/// </summary>
public NoTargetAssessment? NonTargetLesions { get; set; }
/// <summary>
/// 新病灶
/// </summary>
public NewLesionAssessment? NewLesion { get; set; }
/// <summary>
/// 整体疗效
/// </summary>
public OverallAssessment? OverallEfficacy { get; set; }
} }
public class CopySystemCriterionDataInDto public class CopySystemCriterionDataInDto
{ {

View File

@ -86,15 +86,15 @@ namespace IRaCIS.Application.Services
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<List<TumorAssessment>> GetTumorAssessmentList(GetTumorAssessmentListInDto inDto) public async Task<List<TumorAssessmentView>> GetTumorAssessmentList(GetTumorAssessmentListInDto inDto)
{ {
var result= await _tumorAssessmentRepository var result = await _tumorAssessmentRepository
.Where(x => x.CriterionId == inDto.CriterionId) .Where(x => x.CriterionId == inDto.CriterionId)
.WhereIf(!inDto.OverallEfficacy.IsNullOrEmpty(),x=>x.OverallEfficacy==inDto.OverallEfficacy) .WhereIf(inDto.OverallEfficacy != null, x => x.OverallEfficacy == inDto.OverallEfficacy)
.WhereIf(!inDto.TargetLesion.IsNullOrEmpty(), x => x.TargetLesion == inDto.TargetLesion) .WhereIf(inDto.TargetLesion != null, x => x.TargetLesion == inDto.TargetLesion)
.WhereIf(!inDto.NonTargetLesions.IsNullOrEmpty(), x => x.NonTargetLesions == inDto.NonTargetLesions) .WhereIf(inDto.NonTargetLesions != null, x => x.NonTargetLesions == inDto.NonTargetLesions)
.WhereIf(!inDto.NewLesion.IsNullOrEmpty(), x => x.NewLesion == inDto.NewLesion) .WhereIf(inDto.NewLesion != null, x => x.NewLesion == inDto.NewLesion)
.ToListAsync(); .ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider).ToListAsync();
return result; return result;
} }
@ -199,7 +199,8 @@ namespace IRaCIS.Application.Services
{ {
var organData = await _organInfoRepository.Where(x => x.SystemCriterionId == inDto.SourceSystemCriterionId).ToListAsync(); var organData = await _organInfoRepository.Where(x => x.SystemCriterionId == inDto.SourceSystemCriterionId).ToListAsync();
organData.ForEach(x => { organData.ForEach(x =>
{
x.Id = NewId.NextGuid(); x.Id = NewId.NextGuid();
x.SystemCriterionId = inDto.NewSystemCriterionId; x.SystemCriterionId = inDto.NewSystemCriterionId;
}); });
@ -225,8 +226,8 @@ namespace IRaCIS.Application.Services
List<GetSystemCriterionListOutDto> result = await _readingQuestionCriterionSystemRepository.Select(x => new GetSystemCriterionListOutDto() List<GetSystemCriterionListOutDto> result = await _readingQuestionCriterionSystemRepository.Select(x => new GetSystemCriterionListOutDto()
{ {
CriterionId=x.Id, CriterionId = x.Id,
CriterionName=x.CriterionName, CriterionName = x.CriterionName,
}).ToListAsync(); }).ToListAsync();
@ -242,10 +243,10 @@ namespace IRaCIS.Application.Services
public async Task<List<ReadingTableQuestionSystemView>> GetReadingTableQuestionSystemList(ReadingTableQuestionSystemQuery inDto) public async Task<List<ReadingTableQuestionSystemView>> GetReadingTableQuestionSystemList(ReadingTableQuestionSystemQuery inDto)
{ {
var readingTableQuestionSystemQueryable = _readingTableQuestionSystemRepository var readingTableQuestionSystemQueryable = _readingTableQuestionSystemRepository
.WhereIf(inDto.TableQuestionType!=null,x=>x.TableQuestionType ==inDto.TableQuestionType!) .WhereIf(inDto.TableQuestionType != null, x => x.TableQuestionType == inDto.TableQuestionType!)
.Where(x=>x.ReadingQuestionId==inDto.ReadingQuestionId).ProjectTo<ReadingTableQuestionSystemView>(_mapper.ConfigurationProvider); .Where(x => x.ReadingQuestionId == inDto.ReadingQuestionId).ProjectTo<ReadingTableQuestionSystemView>(_mapper.ConfigurationProvider);
var result=await readingTableQuestionSystemQueryable.OrderBy(x=>x.ShowOrder).ToListAsync(); var result = await readingTableQuestionSystemQueryable.OrderBy(x => x.ShowOrder).ToListAsync();
return result; return result;
} }
@ -264,7 +265,7 @@ namespace IRaCIS.Application.Services
.WhereIf(inDto.TableQuestionType != null, x => x.TableQuestionType == inDto.TableQuestionType!) .WhereIf(inDto.TableQuestionType != null, x => x.TableQuestionType == inDto.TableQuestionType!)
.Where(x => x.ReadingQuestionId == inDto.ReadingQuestionId).ProjectTo<ReadingTableQuestionTrialView>(_mapper.ConfigurationProvider); .Where(x => x.ReadingQuestionId == inDto.ReadingQuestionId).ProjectTo<ReadingTableQuestionTrialView>(_mapper.ConfigurationProvider);
var result = await readingTableQuestionSystemQueryable.OrderBy(x=>x.ShowOrder).ToListAsync(); var result = await readingTableQuestionSystemQueryable.OrderBy(x => x.ShowOrder).ToListAsync();
return result; return result;
} }
@ -327,13 +328,13 @@ namespace IRaCIS.Application.Services
[HttpDelete("{Id:guid}")] [HttpDelete("{Id:guid}")]
public async Task<IResponseOutput> DeleteReadingTableQuestionSystem(Guid Id) public async Task<IResponseOutput> DeleteReadingTableQuestionSystem(Guid Id)
{ {
if(await _readingTableQuestionSystemRepository.AnyAsync(x=>x.ParentId==Id||x.RelevanceId==Id)) if (await _readingTableQuestionSystemRepository.AnyAsync(x => x.ParentId == Id || x.RelevanceId == Id))
{ {
return ResponseOutput.NotOk("当前问题存在子问题 删除失败"); return ResponseOutput.NotOk("当前问题存在子问题 删除失败");
} }
await _readingTableQuestionSystemRepository.DeleteFromQueryAsync(t => t.Id == Id); await _readingTableQuestionSystemRepository.DeleteFromQueryAsync(t => t.Id == Id);
var success= await _readingTableQuestionSystemRepository.SaveChangesAsync(); var success = await _readingTableQuestionSystemRepository.SaveChangesAsync();
return ResponseOutput.Result(success); return ResponseOutput.Result(success);
} }
@ -405,7 +406,7 @@ namespace IRaCIS.Application.Services
.WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null) .WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null)
.WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null).CountAsync(); .WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null).CountAsync();
if (judgeCount == 0&&(inDto.ArbitrationRule== ArbitrationRule.Visit|| inDto.ArbitrationRule == ArbitrationRule.Reading)) if (judgeCount == 0 && (inDto.ArbitrationRule == ArbitrationRule.Visit || inDto.ArbitrationRule == ArbitrationRule.Reading))
{ {
throw new BusinessValidationFailedException("无裁判问题却有仲裁对象,操作失败"); throw new BusinessValidationFailedException("无裁判问题却有仲裁对象,操作失败");
} }
@ -428,7 +429,7 @@ namespace IRaCIS.Application.Services
[HttpPost] [HttpPost]
public async Task<NeedSynchronize> VerifyeCriterionNeedSynchronize(VerifyeCriterionNeedSynchronizeInDto inDto) public async Task<NeedSynchronize> VerifyeCriterionNeedSynchronize(VerifyeCriterionNeedSynchronizeInDto inDto)
{ {
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsConfirm).FirstOrDefaultAsync(); var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync();
if (trialCriterion == null) if (trialCriterion == null)
{ {
return NeedSynchronize.NotNeed; return NeedSynchronize.NotNeed;
@ -449,7 +450,7 @@ namespace IRaCIS.Application.Services
foreach (var item in trialQuestionList) foreach (var item in trialQuestionList)
{ {
var systemQuestion= systemQuestionList.Where(x=>x.Id== (item.ReadingQuestionSystemId??default(Guid))).FirstOrDefault(); var systemQuestion = systemQuestionList.Where(x => x.Id == (item.ReadingQuestionSystemId ?? default(Guid))).FirstOrDefault();
if (systemQuestion == null) if (systemQuestion == null)
{ {
return NeedSynchronize.JudgeNotEqual; return NeedSynchronize.JudgeNotEqual;
@ -485,7 +486,7 @@ namespace IRaCIS.Application.Services
/// <returns></returns> /// <returns></returns>
public async Task SynchronizeCriterion(SynchronizeCriterionInDto inDto) public async Task SynchronizeCriterion(SynchronizeCriterionInDto inDto)
{ {
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsConfirm).AsNoTracking().FirstOrDefaultAsync(); var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).AsNoTracking().FirstOrDefaultAsync();
if (trialCriterion != null) if (trialCriterion != null)
{ {
@ -495,7 +496,8 @@ namespace IRaCIS.Application.Services
// 将系统里面的问题转为项目问题 // 将系统里面的问题转为项目问题
var newTrialQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == trialCriterion.ReadingQuestionCriterionSystemId) var newTrialQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == trialCriterion.ReadingQuestionCriterionSystemId)
.ProjectTo<ReadingQuestionTrial>(_mapper.ConfigurationProvider).ToListAsync(); .ProjectTo<ReadingQuestionTrial>(_mapper.ConfigurationProvider).ToListAsync();
newTrialQuestionList.ForEach(x => { newTrialQuestionList.ForEach(x =>
{
x.Id = NewId.NextGuid(); x.Id = NewId.NextGuid();
x.ReadingQuestionCriterionTrialId = trialCriterion.Id; x.ReadingQuestionCriterionTrialId = trialCriterion.Id;
x.TrialId = trialCriterion.TrialId; x.TrialId = trialCriterion.TrialId;
@ -528,7 +530,7 @@ namespace IRaCIS.Application.Services
question = newData.Clone(); question = newData.Clone();
} }
// 最大问题数 // 最大问题数
question.MaxQuestionCount= x.MaxQuestionCount; question.MaxQuestionCount = x.MaxQuestionCount;
if (question.ParentId != null) if (question.ParentId != null)
{ {
question.ParentId = copyNewQuestionList.Where(y => x.ParentId == y.ReadingQuestionSystemId).Select(y => y.Id).FirstOrDefault(); question.ParentId = copyNewQuestionList.Where(y => x.ParentId == y.ReadingQuestionSystemId).Select(y => y.Id).FirstOrDefault();
@ -546,7 +548,7 @@ namespace IRaCIS.Application.Services
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id); await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id);
await _readingQuestionTrialRepository.AddRangeAsync(needAddDatas); await _readingQuestionTrialRepository.AddRangeAsync(needAddDatas);
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x=>x.Id==trialCriterion.Id, x => new ReadingQuestionCriterionTrial() await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.Id == trialCriterion.Id, x => new ReadingQuestionCriterionTrial()
{ {
SynchronizeTime = DateTime.Now SynchronizeTime = DateTime.Now
}); });
@ -559,7 +561,8 @@ namespace IRaCIS.Application.Services
.ProjectTo<ReadingTrialTableQuestionData>(_mapper.ConfigurationProvider).ToListAsync(); .ProjectTo<ReadingTrialTableQuestionData>(_mapper.ConfigurationProvider).ToListAsync();
newTrialTableQuestionList.ForEach(x => { newTrialTableQuestionList.ForEach(x =>
{
x.Id = NewId.NextGuid(); x.Id = NewId.NextGuid();
}); });
@ -618,7 +621,7 @@ namespace IRaCIS.Application.Services
GetTrialJudgyInfoOutDto result = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => new GetTrialJudgyInfoOutDto GetTrialJudgyInfoOutDto result = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => new GetTrialJudgyInfoOutDto
{ {
TrialId = x.Id, TrialId = x.Id,
IsReadingTaskViewInOrder=x.IsReadingTaskViewInOrder, IsReadingTaskViewInOrder = x.IsReadingTaskViewInOrder,
ArbitrationRule = x.ArbitrationRule, ArbitrationRule = x.ArbitrationRule,
IsArbitrationReading = x.IsArbitrationReading IsArbitrationReading = x.IsArbitrationReading
@ -691,7 +694,7 @@ namespace IRaCIS.Application.Services
public async Task<List<GetSystemCriterionSelectDto>> GetSystemCriterionSelectList() public async Task<List<GetSystemCriterionSelectDto>> GetSystemCriterionSelectList()
{ {
var criterionList = await _readingQuestionCriterionSystemRepository.AsQueryable() var criterionList = await _readingQuestionCriterionSystemRepository.AsQueryable()
.OrderBy(x=>x.ShowOrder) .OrderBy(x => x.ShowOrder)
.Select(x => new GetSystemCriterionSelectDto() .Select(x => new GetSystemCriterionSelectDto()
{ {
Id = x.Id, Id = x.Id,
@ -738,7 +741,7 @@ namespace IRaCIS.Application.Services
if (!inDto.IsCompleteConfig) if (!inDto.IsCompleteConfig)
{ {
var trialCriterionIds =await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.Id).Select(x => x.Id).ToListAsync(); var trialCriterionIds = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.Id).Select(x => x.Id).ToListAsync();
if (await _readingTaskQuestionAnswer.AnyAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId))) if (await _readingTaskQuestionAnswer.AnyAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)))
{ {
return ResponseOutput.NotOk("此标准在项目里面已被使用,操作失败"); return ResponseOutput.NotOk("此标准在项目里面已被使用,操作失败");
@ -757,16 +760,16 @@ namespace IRaCIS.Application.Services
await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new ReadingQuestionCriterionSystem() await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new ReadingQuestionCriterionSystem()
{ {
IsCompleteConfig = inDto.IsCompleteConfig, IsCompleteConfig = inDto.IsCompleteConfig,
ConfirmTime= confirmTime, ConfirmTime = confirmTime,
}); });
if (inDto.IsCompleteConfig) if (inDto.IsCompleteConfig)
{ {
//await SynchronizeSystemCriterion(inDto.Id); //await SynchronizeSystemCriterion(inDto.Id);
} }
else else
{ {
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x=>x.ReadingQuestionCriterionSystemId== inDto.Id, x => new ReadingQuestionCriterionTrial() await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == inDto.Id, x => new ReadingQuestionCriterionTrial()
{ {
IsCompleteConfig = inDto.IsCompleteConfig IsCompleteConfig = inDto.IsCompleteConfig
}); });
@ -788,9 +791,10 @@ namespace IRaCIS.Application.Services
IsCompleteConfig = true, IsCompleteConfig = true,
}); });
var systemCriterionQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync(); var systemCriterionQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync();
var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new { var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new
x.Id, {
x.TrialId, x.Id,
x.TrialId,
}).ToListAsync(); }).ToListAsync();
var trialCriterionIdList = trialCriterionList.Select(x => x.Id).ToList(); var trialCriterionIdList = trialCriterionList.Select(x => x.Id).ToList();
List<ReadingQuestionTrial> needAddQuestionList = new List<ReadingQuestionTrial>(); List<ReadingQuestionTrial> needAddQuestionList = new List<ReadingQuestionTrial>();
@ -812,14 +816,15 @@ namespace IRaCIS.Application.Services
/// <returns></returns> /// <returns></returns>
private async Task SynchronizeSystemCriterion(Guid systemCriterionId) private async Task SynchronizeSystemCriterion(Guid systemCriterionId)
{ {
var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x=>x.Id== systemCriterionId); var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x => x.Id == systemCriterionId);
var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new { var trialCriterionList = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).Select(x => new
{
x.Id, x.Id,
x.TrialId, x.TrialId,
}).ToListAsync(); }).ToListAsync();
var trialCriterionIds= trialCriterionList.Select(x => x.Id).ToList(); var trialCriterionIds = trialCriterionList.Select(x => x.Id).ToList();
var systemQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync(); var systemQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterionId).ToListAsync();
var trialQuestions = await _readingQuestionTrialRepository.Where(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)).Select(x => new TrialQuestion var trialQuestions = await _readingQuestionTrialRepository.Where(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)).Select(x => new TrialQuestion
{ {
@ -828,9 +833,9 @@ namespace IRaCIS.Application.Services
Id = x.Id, Id = x.Id,
JudgeType = x.JudgeType, JudgeType = x.JudgeType,
ReadingCriterionPageId = x.ReadingCriterionPageId, ReadingCriterionPageId = x.ReadingCriterionPageId,
RelevanceId=x.RelevanceId, RelevanceId = x.RelevanceId,
RelevanceValue=x.RelevanceValue, RelevanceValue = x.RelevanceValue,
ImageCount=x.ImageCount, ImageCount = x.ImageCount,
ParentId = x.ParentId, ParentId = x.ParentId,
ReadingQuestionCriterionTrialId = x.ReadingQuestionCriterionTrialId, ReadingQuestionCriterionTrialId = x.ReadingQuestionCriterionTrialId,
ReadingQuestionSystemId = x.ReadingQuestionSystemId, ReadingQuestionSystemId = x.ReadingQuestionSystemId,
@ -845,46 +850,46 @@ namespace IRaCIS.Application.Services
var query = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (a, b) => new var query = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (a, b) => new
{ {
a, a,
trialQuestion = b trialQuestion = b
}).SelectMany(a => a.trialQuestion, (m, n) => new ReadingQuestionTrial }).SelectMany(a => a.trialQuestion, (m, n) => new ReadingQuestionTrial
{ {
Id=n.Id, Id = n.Id,
}); });
var needAddQuestionList = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (x, y) => new { system = x, trial = y }) var needAddQuestionList = systemQuestionList.GroupJoin(thisTrialQuestions, a => a.Id, b => b.ReadingQuestionSystemId, (x, y) => new { system = x, trial = y })
.SelectMany( .SelectMany(
a => a.trial.DefaultIfEmpty(), a => a.trial.DefaultIfEmpty(),
(c,d) => new ReadingQuestionTrial (c, d) => new ReadingQuestionTrial
{ {
Id=(c.trial.FirstOrDefault()?.Id)??NewId.NextGuid(), Id = (c.trial.FirstOrDefault()?.Id) ?? NewId.NextGuid(),
ShowOrder=c.system.ShowOrder, ShowOrder = c.system.ShowOrder,
SystemParentId=c.system.ParentId, SystemParentId = c.system.ParentId,
ReadingQuestionSystemId=c.system.Id, ReadingQuestionSystemId = c.system.Id,
AnswerCombination = (c.trial.FirstOrDefault()?.AnswerCombination)??string.Empty, AnswerCombination = (c.trial.FirstOrDefault()?.AnswerCombination) ?? string.Empty,
AnswerGroup= (c.trial.FirstOrDefault()?.AnswerGroup) ?? string.Empty, AnswerGroup = (c.trial.FirstOrDefault()?.AnswerGroup) ?? string.Empty,
GroupName=c.system.GroupName, GroupName = c.system.GroupName,
IsEnable=c.system.IsEnable, IsEnable = c.system.IsEnable,
ShowQuestion= c.system.ShowQuestion, ShowQuestion = c.system.ShowQuestion,
IsJudgeQuestion =c.system.IsJudgeQuestion, IsJudgeQuestion = c.system.IsJudgeQuestion,
IsRequired=c.system.IsRequired, IsRequired = c.system.IsRequired,
JudgeType = (c.trial.FirstOrDefault()?.JudgeType)??JudgeTypeEnum.None, JudgeType = (c.trial.FirstOrDefault()?.JudgeType) ?? JudgeTypeEnum.None,
ParentId = c.trial.FirstOrDefault()?.ParentId, ParentId = c.trial.FirstOrDefault()?.ParentId,
ParentTriggerValue=c.system.ParentTriggerValue, ParentTriggerValue = c.system.ParentTriggerValue,
QuestionName=c.system.QuestionName, QuestionName = c.system.QuestionName,
ReadingCriterionPageId=c.trial.FirstOrDefault()?.ReadingCriterionPageId, ReadingCriterionPageId = c.trial.FirstOrDefault()?.ReadingCriterionPageId,
RelevanceId = c.trial.FirstOrDefault()?.RelevanceId, RelevanceId = c.trial.FirstOrDefault()?.RelevanceId,
ImageCount = c.trial.FirstOrDefault()?.ImageCount??0, ImageCount = c.trial.FirstOrDefault()?.ImageCount ?? 0,
RelevanceValue = c.trial.FirstOrDefault()?.RelevanceValue, RelevanceValue = c.trial.FirstOrDefault()?.RelevanceValue,
ReadingQuestionCriterionTrialId = item.Id, ReadingQuestionCriterionTrialId = item.Id,
Remark=c.system.Remark, Remark = c.system.Remark,
TrialId=item.TrialId, TrialId = item.TrialId,
Type=c.system.Type, Type = c.system.Type,
TypeValue=c.system.TypeValue, TypeValue = c.system.TypeValue,
}).ToList(); }).ToList();
var copydata = needAddQuestionList.Clone(); var copydata = needAddQuestionList.Clone();
needAddQuestionList.ForEach(x => needAddQuestionList.ForEach(x =>
{ {
if (x.SystemParentId == null) if (x.SystemParentId == null)
@ -926,8 +931,9 @@ namespace IRaCIS.Application.Services
if (indto.Id != null) if (indto.Id != null)
{ {
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == indto.Id, x => new ReadingQuestionCriterionTrial() { await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == indto.Id, x => new ReadingQuestionCriterionTrial()
CriterionName=indto.CriterionName {
CriterionName = indto.CriterionName
}); });
} }
@ -1010,7 +1016,7 @@ namespace IRaCIS.Application.Services
//} //}
} }
if (await _readingQuestionSystemRepository.AnyAsync(x => x.Id != indto.Id && x.ShowOrder == indto.ShowOrder&&x.ReadingQuestionCriterionSystemId==indto.ReadingQuestionCriterionSystemId)) if (await _readingQuestionSystemRepository.AnyAsync(x => x.Id != indto.Id && x.ShowOrder == indto.ShowOrder && x.ReadingQuestionCriterionSystemId == indto.ReadingQuestionCriterionSystemId))
{ {
throw new BusinessValidationFailedException("问题编号重复"); throw new BusinessValidationFailedException("问题编号重复");
} }
@ -1026,7 +1032,7 @@ namespace IRaCIS.Application.Services
public async Task<PageOutput<ReadingQuestionSystemView>> GetReadingQuestionSystemList(ReadingQuestionSystemViewInDto inDto) public async Task<PageOutput<ReadingQuestionSystemView>> GetReadingQuestionSystemList(ReadingQuestionSystemViewInDto inDto)
{ {
var query = _readingQuestionSystemRepository.AsQueryable() var query = _readingQuestionSystemRepository.AsQueryable()
.Where(x=>x.ReadingQuestionCriterionSystemId==inDto.ReadingQuestionCriterionSystemId) .Where(x => x.ReadingQuestionCriterionSystemId == inDto.ReadingQuestionCriterionSystemId)
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName))
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type))
.ProjectTo<ReadingQuestionSystemView>(_mapper.ConfigurationProvider); .ProjectTo<ReadingQuestionSystemView>(_mapper.ConfigurationProvider);
@ -1046,14 +1052,14 @@ namespace IRaCIS.Application.Services
{ {
"select","radio" "select","radio"
}; };
var questionList =await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.ReadingQuestionCriterionSystemId) var questionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.ReadingQuestionCriterionSystemId)
.Where(x=> types.Contains(x.Type)) .Where(x => types.Contains(x.Type))
.WhereIf(inDto.Id != null, x => x.Id != inDto.Id&&x.ParentId!= inDto.Id) .WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id)
.Select(x => new CriterionOtherQuestionOutDto() .Select(x => new CriterionOtherQuestionOutDto()
{ {
QuestionId = x.Id, QuestionId = x.Id,
QuestionName = x.QuestionName, QuestionName = x.QuestionName,
TypeValue=x.TypeValue, TypeValue = x.TypeValue,
GroupName = x.GroupName, GroupName = x.GroupName,
}).ToListAsync(); }).ToListAsync();
@ -1086,9 +1092,9 @@ namespace IRaCIS.Application.Services
{ {
var trialUsrSystemIds = _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == trialId && x.ReadingQuestionCriterionSystemId != null) var trialUsrSystemIds = _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == trialId && x.ReadingQuestionCriterionSystemId != null)
.Select(x => x.ReadingQuestionCriterionSystemId); .Select(x => x.ReadingQuestionCriterionSystemId);
var trialCriterionNames= _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == trialId) var trialCriterionNames = _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == trialId)
.Select(x => x.CriterionName); .Select(x => x.CriterionName);
List<ReadingQuestionCriterionTrial> needAddCriterionList = await _readingQuestionCriterionSystemRepository.Where(x => !trialUsrSystemIds.Contains(x.Id)&&x.IsEnable&& !trialCriterionNames.Contains(x.CriterionName)).ProjectTo<ReadingQuestionCriterionTrial>(_mapper.ConfigurationProvider).ToListAsync(); List<ReadingQuestionCriterionTrial> needAddCriterionList = await _readingQuestionCriterionSystemRepository.Where(x => !trialUsrSystemIds.Contains(x.Id) && x.IsEnable && !trialCriterionNames.Contains(x.CriterionName)).ProjectTo<ReadingQuestionCriterionTrial>(_mapper.ConfigurationProvider).ToListAsync();
List<ReadingQuestionTrial> needAddQuestionList = new List<ReadingQuestionTrial>(); List<ReadingQuestionTrial> needAddQuestionList = new List<ReadingQuestionTrial>();
needAddCriterionList.ForEach(x => needAddCriterionList.ForEach(x =>
@ -1114,7 +1120,7 @@ namespace IRaCIS.Application.Services
/// <param name="trialId">项目Id</param> /// <param name="trialId">项目Id</param>
/// <param name="systemQuesitonList">系统问题</param> /// <param name="systemQuesitonList">系统问题</param>
/// <param name="needQuestionList">需要添加list</param> /// <param name="needQuestionList">需要添加list</param>
private void SetChildParentQuestion(Guid ReadingQuestionCriterionTrialId, Guid trialId, List<ReadingQuestionSystem> systemQuesitonList,List<ReadingQuestionTrial> needQuestionList) private void SetChildParentQuestion(Guid ReadingQuestionCriterionTrialId, Guid trialId, List<ReadingQuestionSystem> systemQuesitonList, List<ReadingQuestionTrial> needQuestionList)
{ {
var parentIdIsNullList = systemQuesitonList.Where(x => x.ParentId == null).ToList(); var parentIdIsNullList = systemQuesitonList.Where(x => x.ParentId == null).ToList();
parentIdIsNullList.ForEach(x => parentIdIsNullList.ForEach(x =>
@ -1131,14 +1137,14 @@ namespace IRaCIS.Application.Services
ParentTriggerValue = quesiton.ParentTriggerValue, ParentTriggerValue = quesiton.ParentTriggerValue,
QuestionName = quesiton.QuestionName, QuestionName = quesiton.QuestionName,
ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId, ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
ReadingQuestionSystemId= quesiton.Id, ReadingQuestionSystemId = quesiton.Id,
SystemParentId=quesiton.ParentId, SystemParentId = quesiton.ParentId,
TrialId = trialId, TrialId = trialId,
AnswerGroup = string.Empty, AnswerGroup = string.Empty,
Type = quesiton.Type, Type = quesiton.Type,
GroupName=quesiton.GroupName, GroupName = quesiton.GroupName,
IsJudgeQuestion =quesiton.IsJudgeQuestion, IsJudgeQuestion = quesiton.IsJudgeQuestion,
Remark=quesiton.Remark, Remark = quesiton.Remark,
TypeValue = quesiton.TypeValue, TypeValue = quesiton.TypeValue,
}); });
@ -1155,7 +1161,7 @@ namespace IRaCIS.Application.Services
/// <param name="newParentId"></param> /// <param name="newParentId"></param>
/// <param name="systemQuesitonList"></param> /// <param name="systemQuesitonList"></param>
/// <param name="needQuestionList"></param> /// <param name="needQuestionList"></param>
private void CreateQuestionRelation(Guid ReadingQuestionCriterionTrialId, Guid trialId,Guid oldParentId,Guid newParentId, List<ReadingQuestionSystem> systemQuesitonList, List<ReadingQuestionTrial> needQuestionList) private void CreateQuestionRelation(Guid ReadingQuestionCriterionTrialId, Guid trialId, Guid oldParentId, Guid newParentId, List<ReadingQuestionSystem> systemQuesitonList, List<ReadingQuestionTrial> needQuestionList)
{ {
var childList = systemQuesitonList.Where(x => x.ParentId == oldParentId).ToList(); var childList = systemQuesitonList.Where(x => x.ParentId == oldParentId).ToList();
childList.ForEach(x => childList.ForEach(x =>
@ -1182,7 +1188,7 @@ namespace IRaCIS.Application.Services
IsJudgeQuestion = quesiton.IsJudgeQuestion, IsJudgeQuestion = quesiton.IsJudgeQuestion,
Remark = quesiton.Remark, Remark = quesiton.Remark,
TypeValue = quesiton.TypeValue, TypeValue = quesiton.TypeValue,
}) ; });
CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList); CreateQuestionRelation(ReadingQuestionCriterionTrialId, trialId, oldId, newId, systemQuesitonList, needQuestionList);
}); });
@ -1279,7 +1285,7 @@ namespace IRaCIS.Application.Services
{ {
await AddSystemDataToTrila(inDto.TrialId); await AddSystemDataToTrila(inDto.TrialId);
var query = _readingQuestionCriterionTrialRepository.AsQueryable() var query = _readingQuestionCriterionTrialRepository.AsQueryable()
.Where(x=>x.TrialId==inDto.TrialId) .Where(x => x.TrialId == inDto.TrialId)
.WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName)) .WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName))
.ProjectTo<ReadingQuestionCriterionTrialView>(_mapper.ConfigurationProvider); .ProjectTo<ReadingQuestionCriterionTrialView>(_mapper.ConfigurationProvider);
@ -1322,7 +1328,7 @@ namespace IRaCIS.Application.Services
} }
if (await _readingQuestionTrialRepository.AnyAsync(x => x.Id != indto.Id && x.ShowOrder == indto.ShowOrder&&x.TrialId==indto.TrialId&&x.ReadingQuestionCriterionTrialId==indto.ReadingQuestionCriterionTrialId&&x.ReadingCriterionPageId==indto.ReadingCriterionPageId)) if (await _readingQuestionTrialRepository.AnyAsync(x => x.Id != indto.Id && x.ShowOrder == indto.ShowOrder && x.TrialId == indto.TrialId && x.ReadingQuestionCriterionTrialId == indto.ReadingQuestionCriterionTrialId && x.ReadingCriterionPageId == indto.ReadingCriterionPageId))
{ {
throw new BusinessValidationFailedException("问题编号重复"); throw new BusinessValidationFailedException("问题编号重复");
} }
@ -1341,8 +1347,8 @@ namespace IRaCIS.Application.Services
.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId) .Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId)
.WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName))
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type))
.Where(x => x.ReadingCriterionPageId==inDto.ReadingCriterionPageId) .Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId)
.ProjectTo<ReadingQuestionTrialView>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder); .ProjectTo<ReadingQuestionTrialView>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder);
return await query.ToListAsync(); return await query.ToListAsync();
} }
@ -1368,7 +1374,7 @@ namespace IRaCIS.Application.Services
QuestionId = x.Id, QuestionId = x.Id,
QuestionName = x.QuestionName, QuestionName = x.QuestionName,
TypeValue = x.TypeValue, TypeValue = x.TypeValue,
GroupName=x.GroupName, GroupName = x.GroupName,
}).ToListAsync(); }).ToListAsync();
return questionList; return questionList;
@ -1400,7 +1406,7 @@ namespace IRaCIS.Application.Services
public async Task<List<string>> GetTrialGroupNameList(GetTrialGroupNameListInDto inDto) public async Task<List<string>> GetTrialGroupNameList(GetTrialGroupNameListInDto inDto)
{ {
var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId && x.Type == ReadingQestionType.Group) var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId && x.Type == ReadingQestionType.Group)
.Where(x=>x.ReadingCriterionPageId==inDto.ReadingCriterionPageId) .Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId)
.Select(x => x.GroupName).ToListAsync(); .Select(x => x.GroupName).ToListAsync();
return result; return result;

View File

@ -50,6 +50,8 @@ namespace IRaCIS.Core.Application.Service
CreateMap<ReadModuleAddOrEdit, ReadModule>(); CreateMap<ReadModuleAddOrEdit, ReadModule>();
CreateMap<TumorAssessment, TumorAssessmentView>();
#region 阅片问题 #region 阅片问题
// 忽略列 // 忽略列

View File

@ -16,160 +16,6 @@ namespace IRaCIS.Core.Domain.Share
public static readonly string Group = "group"; public static readonly string Group = "group";
} }
/// <summary>
/// 整体肿瘤评估
/// </summary>
public enum OverallAssessment
{
/// <summary>
/// CR
/// </summary>
CR = 0,
/// <summary>
/// ND
/// </summary>
ND = 1,
/// <summary>
/// NE
/// </summary>
NE = 2,
/// <summary>
/// NN
/// </summary>
NN = 3,
/// <summary>
/// PD
/// </summary>
PD = 4,
/// <summary>
/// PR
/// </summary>
PR = 5,
/// <summary>
/// SD
/// </summary>
SD = 6,
/// <summary>
/// NA
/// </summary>
NA = 6
}
/// <summary>
/// 新病灶评估
/// </summary>
public enum NewLesionAssessment
{
/// <summary>
/// 是
/// </summary>
Yes = 0,
/// <summary>
/// 疑似
/// </summary>
Suspected = 1,
/// <summary>
/// NE
/// </summary>
NE = 2,
/// <summary>
/// 否
/// </summary>
No = 3,
/// <summary>
/// NA
/// </summary>
NA = 4
}
/// <summary>
/// 非靶病灶评估
/// </summary>
public enum NoTargetAssessment
{
/// <summary>
/// PD
/// </summary>
PD = 0,
/// <summary>
/// CR
/// </summary>
CR = 1,
/// <summary>
/// NE
/// </summary>
NE = 2,
/// <summary>
/// ND
/// </summary>
ND = 3,
/// <summary>
/// NN
/// </summary>
NN = 4,
/// <summary>
/// NA
/// </summary>
NA = 5
}
/// <summary>
/// 靶病灶评估
/// </summary>
public enum TargetAssessment
{
/// <summary>
/// CR
/// </summary>
CR = 0,
/// <summary>
/// PR
/// </summary>
PR = 1,
/// <summary>
/// SD
/// </summary>
SD = 2,
/// <summary>
/// PD
/// </summary>
PD = 3,
/// <summary>
/// NE
/// </summary>
NE = 4,
/// <summary>
/// ND
/// </summary>
ND = 5,
/// <summary>
/// NA
/// </summary>
NA = 6
}
/// <summary> /// <summary>