This commit is contained in:
he
2023-03-15 14:48:58 +08:00
parent 58294c2e62
commit 7a61b4fb9c
21 changed files with 441 additions and 160 deletions
@@ -30,7 +30,7 @@ namespace IRaCIS.Application.Services
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
private readonly IRepository<ReadingCriterionPage> _readingCriterionPageRepository;
private readonly IRepository<Trial> _trialRepository;
private readonly IRepository<TumorAssessment> _tumorAssessmentRepository;
private readonly IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository;
private readonly IRepository<OrganInfo> _organInfoRepository;
private readonly IRepository<ReadingTableQuestionSystem> _readingTableQuestionSystemRepository;
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswer;
@@ -50,7 +50,7 @@ namespace IRaCIS.Application.Services
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
IRepository<ReadingCriterionPage> readingCriterionPageRepository,
IRepository<Trial> trialRepository,
IRepository<TumorAssessment> tumorAssessmentRepository,
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
IRepository<OrganInfo> organInfoRepository,
IRepository<ReadingTableQuestionSystem> readingTableQuestionSystemRepository,
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswer,
@@ -15,77 +15,102 @@ namespace IRaCIS.Core.Application.Service.TA
[ApiExplorerSettings(GroupName = "Reading")]
public class ReadingQuestionService : BaseService
{
private readonly IRepository<TumorAssessment> _tumorAssessmentRepository;
public ReadingQuestionService( IRepository<TumorAssessment> tumorAssessmentRepository )
private readonly IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository1Point1;
private readonly IRepository<TumorAssessment_RECIST1Point1BM> _tumorAssessmentRepository1Point1BM;
public ReadingQuestionService( IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository1Point1,
IRepository<TumorAssessment_RECIST1Point1BM> tumorAssessmentRepository1Point1BM
)
{
this._tumorAssessmentRepository = tumorAssessmentRepository;
this._tumorAssessmentRepository1Point1 = tumorAssessmentRepository1Point1;
this._tumorAssessmentRepository1Point1BM = tumorAssessmentRepository1Point1BM;
}
///// <summary>
///// 获取疗效对照
///// </summary>
///// <returns></returns>
//[HttpPost]
//public async Task<List<TumorAssessmentView>> GetTumorAssessmentList(GetTumorAssessmentListInDto inDto)
//{
// var result = await _tumorAssessmentRepository
// .Where(x => x.CriterionId == inDto.CriterionId)
// .WhereIf(inDto.OverallEfficacy != null, x => x.OverallEfficacy == inDto.OverallEfficacy)
// .WhereIf(inDto.TargetLesion != null, x => x.TargetLesion == inDto.TargetLesion)
// .WhereIf(inDto.NonTargetLesions != null, x => x.NonTargetLesions == inDto.NonTargetLesions)
// .WhereIf(inDto.NewLesion != null, x => x.NewLesion == inDto.NewLesion)
// .ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider).ToListAsync();
// return result;
//}
/// <summary>
/// 获取疗效对照
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<List<TumorAssessmentView>> GetTumorAssessmentList(GetTumorAssessmentListInDto inDto)
public async Task<(object,List<ColumnInfo>)> GetTumorAssessmentPageList(GetTumorAssessmentListInDto inQuery)
{
var result = await _tumorAssessmentRepository
.Where(x => x.CriterionId == inDto.CriterionId)
.WhereIf(inDto.OverallEfficacy != null, x => x.OverallEfficacy == inDto.OverallEfficacy)
.WhereIf(inDto.TargetLesion != null, x => x.TargetLesion == inDto.TargetLesion)
.WhereIf(inDto.NonTargetLesions != null, x => x.NonTargetLesions == inDto.NonTargetLesions)
.WhereIf(inDto.NewLesion != null, x => x.NewLesion == inDto.NewLesion)
.ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider).ToListAsync();
return result;
}
var result = new object();
List<ColumnInfo> columnList = new List<ColumnInfo>();
switch (inQuery.CriterionType)
{
case CriterionType.RECIST1Point1:
result= await _tumorAssessmentRepository1Point1.AsQueryable().ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
columnList = new List<ColumnInfo>()
{
new ColumnInfo(){ ColumnName="靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.TargetLesion),DictionaryKey=typeof(TargetAssessment).Name },
new ColumnInfo(){ ColumnName="非靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.NonTargetLesions),DictionaryKey=typeof(NoTargetAssessment).Name },
new ColumnInfo(){ ColumnName="新病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.NewLesion),DictionaryKey=typeof(NewLesionAssessment).Name },
new ColumnInfo(){ ColumnName="整体疗效",ColumnKey=nameof(TumorAssessment_RECIST1Point1.OverallEfficacy),DictionaryKey=typeof(OverallAssessment).Name },
};
break;
case CriterionType.RECIST1Pointt1_MB:
result = await _tumorAssessmentRepository1Point1BM.AsQueryable().ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
columnList = new List<ColumnInfo>()
{
new ColumnInfo(){ ColumnName="靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.TargetLesion),DictionaryKey=typeof(TargetAssessment).Name },
new ColumnInfo(){ ColumnName="非靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.NonTargetLesions),DictionaryKey=typeof(NoTargetAssessment).Name },
new ColumnInfo(){ ColumnName="新病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.NewLesion),DictionaryKey=typeof(NewLesionAssessment).Name },
new ColumnInfo(){ ColumnName="整体疗效",ColumnKey=nameof(TumorAssessment_RECIST1Point1.OverallEfficacy),DictionaryKey=typeof(OverallAssessment).Name },
};
/// <summary>
/// 获取疗效对照
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<TumorAssessmentView>> GetTumorAssessmentPageList(GetTumorAssessmentListInDto inQuery)
{
var query = _tumorAssessmentRepository
.Where(x => x.CriterionId == inQuery.CriterionId)
.WhereIf(inQuery.OverallEfficacy != null, x => x.OverallEfficacy == inQuery.OverallEfficacy)
.WhereIf(inQuery.TargetLesion != null, x => x.TargetLesion == inQuery.TargetLesion)
.WhereIf(inQuery.NonTargetLesions != null, x => x.NonTargetLesions == inQuery.NonTargetLesions)
.WhereIf(inQuery.NewLesion != null, x => x.NewLesion == inQuery.NewLesion)
.ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider);
break;
}
return (result, columnList);
return await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
}
/// <summary>
/// 新增修改疗效对照
/// </summary>
/// <param name="indto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> AddOrUpdateTumorAssessment(AddOrUpdateTumorAssessmentInDto indto)
{
///// <summary>
///// 新增修改疗效对照
///// </summary>
///// <param name="indto"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<IResponseOutput> AddOrUpdateTumorAssessment(AddOrUpdateTumorAssessmentInDto indto)
//{
var entity = await _tumorAssessmentRepository.InsertOrUpdateAsync(indto, true);
// var entity = await _tumorAssessmentRepository.InsertOrUpdateAsync(indto, true);
return ResponseOutput.Ok(entity.Id.ToString());
// return ResponseOutput.Ok(entity.Id.ToString());
}
//}
/// <summary>
/// 删除疗效对照
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpDelete("{Id:guid}")]
public async Task<IResponseOutput> DeleteTumorAssessment(Guid Id)
{
await _tumorAssessmentRepository.DeleteFromQueryAsync(t => t.Id == Id);
var success = await _tumorAssessmentRepository.SaveChangesAsync();
return ResponseOutput.Result(success);
}
///// <summary>
///// 删除疗效对照
///// </summary>
///// <param name="Id"></param>
///// <returns></returns>
//[HttpDelete("{Id:guid}")]
//public async Task<IResponseOutput> DeleteTumorAssessment(Guid Id)
//{
// await _tumorAssessmentRepository.DeleteFromQueryAsync(t => t.Id == Id);
// var success = await _tumorAssessmentRepository.SaveChangesAsync();
// return ResponseOutput.Result(success);
//}
}
}