diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 5912e5d69..4da3704f3 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -145,6 +145,42 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List OncologyVisits { get; set; } = new List(); } + public class GetRelatedVisitTaskOutDto + { + public Guid VisitTaskId { get; set; } + public string TaskName { get; set; } + + public string TaskBlindName { get; set; } + + public decimal VisitTaskNum { get; set; } + + public Guid? VisitId { get; set; } + + public bool IsCurrentTask { get; set; } + } + + public class GetVisitReadingQuestionOutDto + { + public Guid QuestionId { get; set; } + + public Guid QuestionName { get; set; } + + //public + } + + public class GetVisitReadingQuestionInDto + { + public Guid TrialId { get; set; } + + public Guid VisitTaskId { get; set; } + } + + public class GetRelatedVisitTaskInDto + { + [NotDefault] + public Guid VisitTaskId { get; set; } + } + public class GetOncologyReadingInfoInDto { public Guid VisitTaskId { get; set; } @@ -499,6 +535,34 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } + public class SubmitTableQuestionInDto + { + public Guid QuestionId { get; set; } + + public int RowIndex { get; set; } + + /// + /// 任务Id + /// + public Guid TaskId { get; set; } + + /// + /// 项目Id + /// + public Guid TrialId { get; set; } + + + public List AnswerList { get; set; } + + } + + public class SubmitTableQuestionInfo + { + public Guid TableQuestionId { get; set; } + + public string Answer { get; set; } + } + public class GetTrialReadingQuestionInDto { [NotDefault] @@ -706,5 +770,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List Childrens { get; set; } } + ///// + ///// 表格问题 + ///// + //public class GetTrialReadingTableQuestion + //{ + // public List<> class TrialReadingTableQuestion + //} + + //public class TrialReadingTableQuestion + //{ + + //} } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 2c9326586..2fd3b04ca 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -30,6 +30,7 @@ namespace IRaCIS.Application.Services private readonly IRepository _noneDicomStudyRepository; private readonly IRepository _visitTaskRepository; private readonly IRepository _trialRepository; + private readonly IRepository _readingTableQuestionAnswerRepository; private readonly IRepository _readingOncologyTaskInfoRepository; private readonly IVisitTaskHelpeService _visitTaskHelpeService; private readonly IVisitTaskService _visitTaskService; @@ -52,10 +53,10 @@ namespace IRaCIS.Application.Services IRepository noneDicomStudyRepository, IRepository visitTaskRepository, IRepository TrialRepository, - IRepository ReadingOncologyTaskInfoRepository, - + IRepository ReadingTableQuestionAnswerRepository, + IRepository ReadingOncologyTaskInfoRepository, IVisitTaskHelpeService visitTaskHelpeService, - IVisitTaskService visitTaskService, + IVisitTaskService visitTaskService, IReadingClinicalDataService readingClinicalDataService, IRepository subjectVisitRepository, IRepository subjectRepository, @@ -66,7 +67,7 @@ namespace IRaCIS.Application.Services IRepository readingTaskQuestionAnswerRepository, IRepository readingQuestionCriterionTrialRepository, IRepository readingQuestionCriterionSystemRepository, - IRepository ReadingQuestionSystem, + IRepository ReadingQuestionSystem, IRepository readingQuestionTrialRepository ) { @@ -74,6 +75,7 @@ namespace IRaCIS.Application.Services this._noneDicomStudyRepository = noneDicomStudyRepository; this._visitTaskRepository = visitTaskRepository; this._trialRepository = TrialRepository; + this._readingTableQuestionAnswerRepository = ReadingTableQuestionAnswerRepository; this._readingOncologyTaskInfoRepository = ReadingOncologyTaskInfoRepository; this._visitTaskHelpeService = visitTaskHelpeService; this._visitTaskService = visitTaskService; @@ -91,6 +93,51 @@ namespace IRaCIS.Application.Services this._readingQuestionTrialRepository = readingQuestionTrialRepository; } + #region 表格问题相关 + + + //public async Task<> GetVisitReadingQuestion(GetVisitReadingQuestionInDto inDto) + //{ + + //} + + + /// + /// 获取关联的阅片任务 + /// + /// + /// + [HttpPost] + public async Task> GetRelatedVisitTask(GetRelatedVisitTaskInDto inDto) + { + var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); + var result = await _visitTaskRepository.Where(x => + (x.TrialId == taskInfo.TrialId && + x.SubjectId == taskInfo.SubjectId && + x.ArmEnum == taskInfo.ArmEnum && + x.DoctorUserId == taskInfo.DoctorUserId && + x.ReadingTaskState == ReadingTaskState.HaveSigned && + x.TaskState == TaskState.Effect && + x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && + x.ReadingCategory == ReadingCategory.Visit) || x.Id == inDto.VisitTaskId) + .Select(x => new GetRelatedVisitTaskOutDto() + { + TaskBlindName=x.TaskBlindName, + TaskName=x.TaskName, + VisitId=x.SourceSubjectVisitId, + VisitTaskId=x.Id, + VisitTaskNum=x.VisitTaskNum, + IsCurrentTask=x.Id==inDto.VisitTaskId, + + }).OrderBy(x => x.VisitTaskNum).ToListAsync(); + + + + return result; + } + #endregion + + #region 肿瘤学阅片相关 /// @@ -655,6 +702,8 @@ namespace IRaCIS.Application.Services } #endregion + + #region 获取项目的阅片问题 /// /// 获取项目的阅片问题 @@ -1089,6 +1138,9 @@ namespace IRaCIS.Application.Services } #endregion + + + #region 获取既往结果 /// /// 获取既往结果 @@ -1171,6 +1223,30 @@ namespace IRaCIS.Application.Services #region 提交问题 + /// + /// 提交表格问题 + /// + /// + /// + [HttpPost] + public async Task SubmitTableQuestion(SubmitTableQuestionInDto inDto) + { + await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.TaskId == inDto.TaskId && x.QuestionId == inDto.QuestionId && x.TrialId == inDto.TrialId); + List answerList = inDto.AnswerList.Select(x => new ReadingTableQuestionAnswer() + { + Answer=x.Answer, + Id= NewId.NextGuid(), + TrialId=inDto.TrialId, + QuestionId=inDto.QuestionId, + TableQuestionId=x.TableQuestionId, + RowIndex=inDto.RowIndex, + TaskId=inDto.TaskId + }).ToList(); + await _readingTableQuestionAnswerRepository.AddRangeAsync(answerList); + await _readingTableQuestionAnswerRepository.SaveChangesAsync(); + return ResponseOutput.Ok(true); + } + /// /// 提交访视阅片问题 /// diff --git a/IRaCIS.Core.Domain/Reading/ReadingTableQuestionAnswer.cs b/IRaCIS.Core.Domain/Reading/ReadingTableQuestionAnswer.cs index b4450d016..96d2843ab 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingTableQuestionAnswer.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingTableQuestionAnswer.cs @@ -20,10 +20,15 @@ namespace IRaCIS.Core.Domain.Models /// public Guid QuestionId { get; set; } - + /// - /// 任务Id - /// + /// 表格问题Id + /// + public Guid TableQuestionId { get; set; } + + /// + /// 任务Id + /// public Guid TaskId { get; set; } ///