diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 219fc52d9..168c92466 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -1274,6 +1274,61 @@ 上传方式名称 + + + 返回对象 + + + + + 标准 + + + + + + + + + + 项目Id + + + + + 类型 + + + + + 父问题触发 + + + + + 问题名称 + + + + + 是否是必须 + + + + + 排序 + + + + + 父问题ID + + + + + 类型值 + + 项目ID @@ -4080,6 +4135,32 @@ + + + IR影像阅片 + + + + + 获取阅片非Dicom文件 + + + + + + + 获取项目已确认的标准 + + + + + + + 获取项目的阅片问题 + + + + 阅片期配置 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingClinicalDataDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingClinicalDataDto.cs index 0c9c40644..bc8d29c2b 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingClinicalDataDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingClinicalDataDto.cs @@ -282,7 +282,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 项目ID /// - [Required(ErrorMessage = "TrialId为null")] + [NotDefault] public Guid TrialId { get; set; } /// @@ -293,16 +293,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 对象ID /// - [Required(ErrorMessage = "ReadingId为null")] public Guid? ReadingId { get; set; } - [Required(ErrorMessage = "SubjectId为null")] public Guid? SubjectId { get; set; } /// /// 是否是访视 /// - [Required(ErrorMessage = "IsVisit为null")] public bool? IsVisit { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs new file mode 100644 index 000000000..5384b585c --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Application.Service.Reading.Dto +{ + + public class GetReadingImgOutDto + { + public string Path { get; set; } + + public string FileName { get; set; } + } + + public class GetReadingImgInDto + { + + public Guid SubjectVisitId { get; set; } + } + + public class GetConfirmCriterionInDto + { + [NotDefault] + public Guid TrialId { get; set; } + } + + + + /// + /// 返回对象 + /// + public class GetTrialConfirmCriterionListOutDto + { + public Guid CriterionId { get; set; } + + /// + /// 标准 + /// + public string CriterionName { get; set; } + } + + + public class GetTrialReadingQuestionInDto + { + [NotDefault] + public Guid CriterionId { get; set; } + } + + /// + /// + /// + public class SubmitVisitTaskQuestionsInDto + { + public Guid VisitTaskId { get; set; } + + public List AnswerList { get; set; } = new List(); + } + + + public class QuestionAnswer + { + public Guid TrialQuestionId { get; set; } + + public string Answer { get; set; } + } + + public class GetTrialReadingQuestionOutDto + { + + public Guid Id { get; set; } + + /// + /// 项目Id + /// + public Guid TrialId { get; set; } + + /// + /// 类型 + /// + public string Type { get; set; } + + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } + + /// + /// 是否是必须 + /// + public bool IsRequired { get; set; } + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } + + + /// + /// 类型值 + /// + public string TypeValue { get; set; } + } + + +} diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingClinicalDataService.cs index 81b713e19..076532270 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingClinicalDataService.cs @@ -253,7 +253,6 @@ namespace IRaCIS.Application.Services var result = await _readingClinicalDataPDFRepository.Where(x => x.ReadingClinicalDataId == inDto.ReadingClinicalDataId).ProjectTo(_mapper.ConfigurationProvider) .ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(GetReadingClinicalDataPDFListOutDto.FileName) : inDto.SortField, inDto.Asc); - return result; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs new file mode 100644 index 000000000..13de43e65 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -0,0 +1,103 @@ +using IRaCIS.Application.Interfaces; +using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Application.Filter; +using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Service.WorkLoad.DTO; +using Microsoft.AspNetCore.Authorization; +using IRaCIS.Core.Application.Auth; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share.Reading; +using MassTransit; +using IRaCIS.Core.Application.Service.Reading; +using IRaCIS.Core.Infra.EFCore.Common; +using Panda.DynamicWebApi.Attributes; + +namespace IRaCIS.Application.Services +{ + /// + /// IR影像阅片 + /// + [ApiExplorerSettings(GroupName = "Reading")] + public class ReadingImageTaskService : BaseService + { + private readonly IRepository _noneDicomStudyRepository; + private readonly IRepository _visitTaskRepository; + private readonly IRepository _readingQuestionCriterionTrialRepository; + private readonly IRepository _readingQuestionTrialRepository; + + public ReadingImageTaskService( + IRepository noneDicomStudyRepository, + IRepository visitTaskRepository, + IRepository readingQuestionCriterionTrialRepository, + IRepository readingQuestionTrialRepository + ) + { + this._noneDicomStudyRepository = noneDicomStudyRepository; + this._visitTaskRepository = visitTaskRepository; + this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository; + this._readingQuestionTrialRepository = readingQuestionTrialRepository; + } + + /// + /// 获取阅片非Dicom文件 + /// + /// + /// + [HttpPost] + public async Task> GetReadingImageFile(GetReadingImgInDto inDto) + { + List imgList =await _noneDicomStudyRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId) + .SelectMany(x => x.NoneDicomFileList).Select(x=> new GetReadingImgOutDto() { + FileName=x.FileName, + Path=x.Path + }).ToListAsync(); + return imgList; + } + + /// + /// 获取项目已确认的标准 + /// + /// + /// + [HttpPost] + public async Task> GetTrialConfirmCriterionList(GetConfirmCriterionInDto inDto) + { + var result= await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsConfirm) + .Select(x => new GetTrialConfirmCriterionListOutDto() + { + CriterionId = x.Id, + CriterionName = x.CriterionName + }).ToListAsync(); + return result; + } + + /// + /// 获取项目的阅片问题 + /// + /// + /// + [HttpPost] + public async Task> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto) + { + var result = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.CriterionId) + .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + return result; + } + + ///// + ///// + ///// + ///// + ///// + //public async Task SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto InDto) + //{ + + + //} + + + + + } +} diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs index 33b17f59b..22da4cd1d 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs @@ -167,7 +167,6 @@ namespace IRaCIS.Application.Services PageSize = inDto.PageSize, PageIndex = inDto.PageIndex, TotalCount = totalCount, - }; return result; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs index 2db911b99..31ace53df 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingQuestionService.cs @@ -185,7 +185,7 @@ namespace IRaCIS.Application.Services }; var questionList =await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.ReadingQuestionCriterionSystemId) .Where(x=> types.Contains(x.Type)) - .WhereIf(inDto.Id != null, x => x.Id != inDto.Id) + .WhereIf(inDto.Id != null, x => x.Id != inDto.Id&&x.ParentId!= inDto.Id) .Select(x => new CriterionOtherQuestionOutDto() { QuestionId = x.Id, @@ -421,7 +421,7 @@ namespace IRaCIS.Application.Services }; var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId) .Where(x => types.Contains(x.Type)) - .WhereIf(inDto.Id != null, x => x.Id != inDto.Id) + .WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id) .Select(x => new CriterionOtherQuestionOutDto() { QuestionId = x.Id, diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 883e886ca..6fc8555ba 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -70,7 +70,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentReadingQuestionTrial == null ? string.Empty : s.ParentReadingQuestionTrial.QuestionName)); ; #endregion - + #region IR阅片 + CreateMap(); + #endregion diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index f6e821c49..95c93037e 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -200,4 +200,12 @@ namespace IRaCIS.Core.Domain.Share.Reading [DisplayAttribute(Name = "阅片")] Read = 2, } + + /// + /// 阅片状态 + /// + public enum ReadingStatusEnum + { + None=0, + } } diff --git a/IRaCIS.Core.Domain/Reading/ReadModule.cs b/IRaCIS.Core.Domain/Reading/ReadModule.cs index b2c4956a5..00ef5bd43 100644 --- a/IRaCIS.Core.Domain/Reading/ReadModule.cs +++ b/IRaCIS.Core.Domain/Reading/ReadModule.cs @@ -120,6 +120,9 @@ namespace IRaCIS.Core.Domain.Models [ForeignKey("LastVisitIdSetId")] public SubjectVisit LastSubjectVisit { get; set; } + + public ReadingStatusEnum ReadingStatus { get; set; } + } diff --git a/IRaCIS.Core.Domain/Reading/ReadingPeriodSet.cs b/IRaCIS.Core.Domain/Reading/ReadingPeriodSet.cs index 6f0549677..80603af06 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingPeriodSet.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingPeriodSet.cs @@ -55,7 +55,7 @@ namespace IRaCIS.Core.Domain.Models /// /// 是否生效 /// - public ReadingPeriodStatus IsTakeEffect { get; set; } + public ReadingPeriodStatus IsTakeEffect { get; set; } /// /// 生效时间 @@ -92,6 +92,4 @@ namespace IRaCIS.Core.Domain.Models public List ReadingPeriodPlanList { get; set; } = new List(); } - - } diff --git a/IRaCIS.Core.Domain/Reading/ReadingQuestionAnswerTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingQuestionAnswerTrial.cs index d8c0d8552..a95edf035 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingQuestionAnswerTrial.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingQuestionAnswerTrial.cs @@ -10,10 +10,10 @@ using System.Collections.Generic; namespace IRaCIS.Core.Domain.Models { /// - /// 项目阅片问题答案 + /// 阅片任务答案 /// - [Table("ReadingQuestionAnswerTrial")] - public class ReadingQuestionAnswerTrial : Entity, IAuditAdd + [Table("ReadingTaskQuestionAnswer")] + public class ReadingTaskQuestionAnswer : Entity, IAuditAdd { /// /// 项目问题Id @@ -31,9 +31,9 @@ namespace IRaCIS.Core.Domain.Models public Guid SubjectId { get; set; } /// - /// 阅片Id + /// 任务Id /// - public Guid ReadingId { get; set; } + public Guid VisitTaskId { get; set; } /// /// 答案 diff --git a/IRaCIS.Core.Domain/Reading/View/ReadModuleView.cs b/IRaCIS.Core.Domain/Reading/View/ReadModuleView.cs index 2b8a7c8e8..bc042d1c2 100644 --- a/IRaCIS.Core.Domain/Reading/View/ReadModuleView.cs +++ b/IRaCIS.Core.Domain/Reading/View/ReadModuleView.cs @@ -138,5 +138,11 @@ namespace IRaCIS.Core.Domain.Models /// 入组确认评估 /// public bool IsEnrollmentConfirm { get; set; } = false; + + + /// + /// 阅片状态 + /// + public ReadingStatusEnum ReadingStatus { get; set; } } } diff --git a/IRaCIS.Core.Domain/Visit/SubjectVisit.cs b/IRaCIS.Core.Domain/Visit/SubjectVisit.cs index eee6ee9aa..e76c9bd08 100644 --- a/IRaCIS.Core.Domain/Visit/SubjectVisit.cs +++ b/IRaCIS.Core.Domain/Visit/SubjectVisit.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share.Reading; using Microsoft.EntityFrameworkCore.Metadata.Internal; namespace IRaCIS.Core.Domain.Models @@ -206,9 +207,8 @@ namespace IRaCIS.Core.Domain.Models public List QCChallengeDialogList { get; set; } = new List(); + public ReadingStatusEnum ReadingStatus { get; set; } + } - - - } diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 4b51a1a62..6605374b3 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -179,6 +179,7 @@ namespace IRaCIS.Core.Infra.EFCore #region Reading public virtual DbSet ReadingPeriodSet { get; set; } + public virtual DbSet ReadingTaskQuestionAnswer { get; set; } public virtual DbSet ReadingPeriodPlan { get; set; } public virtual DbSet ReadingClinicalData { get; set; }