From b8e0c74d451e52ff48342febb110f45b40026fa1 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 1 Aug 2024 10:50:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Management/DTO/UserFeedBackViewModel.cs | 10 ++++ .../Service/Management/UserFeedBackService.cs | 60 +++++++++++++++++-- IRaCIS.Core.Domain/Management/UserFeedBack.cs | 6 ++ 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs index 5635af438..b3c1098b2 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 { @@ -78,6 +86,8 @@ namespace IRaCIS.Core.Application.ViewModel [NotDefault] public Guid TrialId { get; set; } + public Guid? VisitTaskId { get; set; } + public List ScreenshotList { get; set; } [JsonIgnore] diff --git a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs index e21a818fe..f24fd97c7 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,81 @@ 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); return pageList; } + [HttpPost] + public async Task GetUserFeedBackInfo(GetUserFeedBackQuery inQuery) + { + if (inQuery.Id == null && inQuery.VisitTaskId == null) + { + throw new BusinessValidationFailedException("Id 或者VisitTaskId 必传一个"); + } + + var result = _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; } From a6b8db30c3b020e4ceaed577657786034d158fb0 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 1 Aug 2024 11:48:24 +0800 Subject: [PATCH 2/5] =?UTF-8?q?scp=20=E4=BC=A0=E8=BE=93=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) 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 }; From 3e5d0b650dbb2c7db0c37bcb7e42efab1c2d29ca Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 1 Aug 2024 13:17:23 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=88=AA=E5=9B=BE=E7=BB=99=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/DTO/UserFeedBackViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs index b3c1098b2..cb375a0db 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs @@ -91,7 +91,7 @@ namespace IRaCIS.Core.Application.ViewModel public List ScreenshotList { get; set; } [JsonIgnore] - public string ScreenshotListStr { get; set; } + public string ScreenshotListStr { get; set; } = string.Empty; } From 7069a17d8ee0404220f8e1e750c92180ad420cd6 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 1 Aug 2024 13:31:53 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=BF=85=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 16 ++++++++++++++-- .../Management/DTO/UserFeedBackViewModel.cs | 2 +- .../Service/Management/UserFeedBackService.cs | 5 +---- 3 files changed, 16 insertions(+), 7 deletions(-) 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 cb375a0db..14a6fcd70 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs @@ -53,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; } diff --git a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs index f24fd97c7..2f06b3fd0 100644 --- a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs @@ -48,10 +48,7 @@ namespace IRaCIS.Core.Application.Service .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; } From 9cd4e272c728a99cab9f3d56be6b46c3940b6e36 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 1 Aug 2024 13:36:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E9=81=97=E6=BC=8Fawait?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserFeedBackService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs index 2f06b3fd0..a9217b6a5 100644 --- a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs @@ -61,7 +61,7 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException("Id 或者VisitTaskId 必传一个"); } - var result = _userFeedBackRepository.WhereIf(inQuery.Id == null, t => t.VisitTaskId == inQuery.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);