diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index 539e24b36..6cfb381ad 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -58,21 +58,21 @@ namespace IRaCIS.Core.SCP.Service private static readonly DicomTransferSyntax[] _acceptedImageTransferSyntaxes = new DicomTransferSyntax[] { - // Lossless - DicomTransferSyntax.JPEGLSLossless, - DicomTransferSyntax.JPEG2000Lossless, - DicomTransferSyntax.JPEGProcess14SV1, - DicomTransferSyntax.JPEGProcess14, - DicomTransferSyntax.RLELossless, + // Lossless + DicomTransferSyntax.JPEGLSLossless, //1.2.840.10008.1.2.4.80 + DicomTransferSyntax.JPEG2000Lossless, //1.2.840.10008.1.2.4.90 + DicomTransferSyntax.JPEGProcess14SV1, //1.2.840.10008.1.2.4.70 + DicomTransferSyntax.JPEGProcess14, //1.2.840.10008.1.2.4.57 JPEG Lossless, Non-Hierarchical (Process 14) + DicomTransferSyntax.RLELossless, //1.2.840.10008.1.2.5 // Lossy - DicomTransferSyntax.JPEGLSNearLossless, - DicomTransferSyntax.JPEG2000Lossy, - DicomTransferSyntax.JPEGProcess1, - DicomTransferSyntax.JPEGProcess2_4, + DicomTransferSyntax.JPEGLSNearLossless,//1.2.840.10008.1.2.4.81" + DicomTransferSyntax.JPEG2000Lossy, //1.2.840.10008.1.2.4.91 + DicomTransferSyntax.JPEGProcess1, //1.2.840.10008.1.2.4.50 + DicomTransferSyntax.JPEGProcess2_4, //1.2.840.10008.1.2.4.51 // Uncompressed - DicomTransferSyntax.ExplicitVRLittleEndian, - DicomTransferSyntax.ExplicitVRBigEndian, - DicomTransferSyntax.ImplicitVRLittleEndian + DicomTransferSyntax.ExplicitVRLittleEndian, //1.2.840.10008.1.2.1 + DicomTransferSyntax.ExplicitVRBigEndian, //1.2.840.10008.1.2.2 + DicomTransferSyntax.ImplicitVRLittleEndian //1.2.840.10008.1.2 }; diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index fa33a1f82..a79b6199f 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -5303,6 +5303,11 @@ 只查询已经签名的临床数据 + + + 是否查询所有的一致性分析临床数据 (为否只查询PDF) + + 获取访视列表 @@ -14129,13 +14134,20 @@ - + - 获取阅片临床数据列表 + 获取阅片临床数据列表 (在任务列表) + + + 新增或修改一致性分析临床数据 + + + + 获取单个阅片临床数据的所有文件 diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs index 5635af438..14a6fcd70 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs @@ -35,6 +35,14 @@ namespace IRaCIS.Core.Application.ViewModel public UserTypeEnum UserTypeEnum { get; set; } } + + public class GetUserFeedBackQuery + { + public Guid? Id { get; set; } + + public Guid? VisitTaskId { get; set; } + } + ///UserFeedBackQuery 列表查询参数模型 public class UserFeedBackQuery : PageInput { @@ -45,7 +53,7 @@ namespace IRaCIS.Core.Application.ViewModel public UserTypeEnum? UserTypeEnum { get; set; } - public string FeedBackKeyInfo { get; set; } + public string? FeedBackKeyInfo { get; set; } public string? QuestionDescription { get; set; } @@ -78,10 +86,12 @@ namespace IRaCIS.Core.Application.ViewModel [NotDefault] public Guid TrialId { get; set; } + public Guid? VisitTaskId { get; set; } + public List ScreenshotList { get; set; } [JsonIgnore] - public string ScreenshotListStr { get; set; } + public string ScreenshotListStr { get; set; } = string.Empty; } diff --git a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs index e21a818fe..a9217b6a5 100644 --- a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs @@ -9,6 +9,8 @@ using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; using Newtonsoft.Json; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; namespace IRaCIS.Core.Application.Service { /// @@ -29,33 +31,78 @@ namespace IRaCIS.Core.Application.Service public async Task> GetUserFeedBackList(UserFeedBackQuery inQuery) { + var isCRCOrIR = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer; + var userFeedBackQueryable = _userFeedBackRepository + .WhereIf(isCRCOrIR, t => t.CreateUserId == _userInfo.Id) .WhereIf(inQuery.State != null, t => t.State == inQuery.State) .WhereIf(inQuery.QuestionType != null, t => t.QuestionType == inQuery.QuestionType) .WhereIf(inQuery.BeginCreatime != null, t => t.CreateTime >= inQuery.BeginCreatime) - + .WhereIf(inQuery.EndCreatime != null, t => t.CreateTime == inQuery.EndCreatime) .WhereIf(inQuery.UserTypeEnum != null, t => t.CreateUser.UserTypeEnum == inQuery.UserTypeEnum) - .WhereIf(!string.IsNullOrEmpty(inQuery.QuestionDescription), t => t.QuestionDescription.Contains(inQuery.QuestionDescription) ) + .WhereIf(!string.IsNullOrEmpty(inQuery.QuestionDescription), t => t.QuestionDescription.Contains(inQuery.QuestionDescription)) .WhereIf(!string.IsNullOrEmpty(inQuery.TrialKeyInfo), t => t.Trial.ExperimentName.Contains(inQuery.TrialKeyInfo) || t.Trial.TrialCode.Contains(inQuery.TrialKeyInfo)) .WhereIf(!string.IsNullOrEmpty(inQuery.SubejctAndVisitKeyInfo), t => t.Subject.Code.Contains(inQuery.SubejctAndVisitKeyInfo) || t.SubjectVisit.VisitName.Contains(inQuery.SubejctAndVisitKeyInfo)) - .WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode) ) - + .WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode)) + .ProjectTo(_mapper.ConfigurationProvider); - var pageList = await userFeedBackQueryable - - .ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(UserFeedBackView.Id) : inQuery.SortField, - inQuery.Asc); + var pageList = await userFeedBackQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(UserFeedBackView.Id) : inQuery.SortField,inQuery.Asc); return pageList; } + [HttpPost] + public async Task GetUserFeedBackInfo(GetUserFeedBackQuery inQuery) + { + if (inQuery.Id == null && inQuery.VisitTaskId == null) + { + throw new BusinessValidationFailedException("Id 或者VisitTaskId 必传一个"); + } + + var result = await _userFeedBackRepository.WhereIf(inQuery.Id == null, t => t.VisitTaskId == inQuery.VisitTaskId) + .WhereIf(inQuery.VisitTaskId == null, t => t.Id == inQuery.Id).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(); + + return ResponseOutput.Ok(result); + } + public async Task AddOrUpdateUserFeedBack(UserFeedBackAddOrEdit addOrEditUserFeedBack) { addOrEditUserFeedBack.ScreenshotListStr = JsonConvert.SerializeObject(addOrEditUserFeedBack.ScreenshotList); + if (addOrEditUserFeedBack.VisitTaskId != null) + { + var info = await _repository.Where(t => t.Id == addOrEditUserFeedBack.VisitTaskId).Select(t => new { t.SubjectId, t.SourceSubjectVisitId, t.Subject.TrialSiteId }).FirstOrDefaultAsync(); + + if (info != null) + { + addOrEditUserFeedBack.SubjectId = info.SubjectId; + addOrEditUserFeedBack.TrialSiteId = info.TrialSiteId; + addOrEditUserFeedBack.SubjectVisitId = info.SourceSubjectVisitId; + } + } + + else if (addOrEditUserFeedBack.SubjectVisitId != null) + { + var info = await _repository.Where(t => t.Id == addOrEditUserFeedBack.SubjectVisitId).Select(t => new { t.TrialSiteId, t.SubjectId }).FirstOrDefaultAsync(); + + if (info != null) + { + addOrEditUserFeedBack.TrialSiteId = info.TrialSiteId; + addOrEditUserFeedBack.SubjectId = info.SubjectId; + } + } + else if (addOrEditUserFeedBack.SubjectId != null) + { + var info = await _repository.Where(t => t.Id == addOrEditUserFeedBack.SubjectId).Select(t => new { t.TrialSiteId }).FirstOrDefaultAsync(); + + if (info != null) + { + addOrEditUserFeedBack.TrialSiteId = info.TrialSiteId; + } + } var entity = await _userFeedBackRepository.InsertOrUpdateAsync(addOrEditUserFeedBack, true); diff --git a/IRaCIS.Core.Domain/Management/UserFeedBack.cs b/IRaCIS.Core.Domain/Management/UserFeedBack.cs index d9ec5f7bb..999a4c04e 100644 --- a/IRaCIS.Core.Domain/Management/UserFeedBack.cs +++ b/IRaCIS.Core.Domain/Management/UserFeedBack.cs @@ -27,6 +27,12 @@ namespace IRaCIS.Core.Domain.Models [JsonIgnore] public User CreateUser { get; set; } + [JsonIgnore] + + public VisitTask VisitTask { get; set; } + + public Guid? VisitTaskId { get; set; } + public Guid? SubjectId { get; set; }