diff --git a/IRaCIS.Core.Application/Service/Common/DTO/FileUploadRecordViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/FileUploadRecordViewModel.cs index 95c632ece..c25cea6e2 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/FileUploadRecordViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/FileUploadRecordViewModel.cs @@ -124,6 +124,11 @@ public class FileUploadRecordQuery : PageInput public string StudyCode { get; set; } + public string? SubjectCode { get; set; } + + public string? VisitName { get; set; } + + public Guid? SubjectId { get; set; } public Guid? SubjectVisitId { get; set; } @@ -211,6 +216,12 @@ public class UploadFileSyncRecordQuery : PageInput public jobState? JobState { get; set; } + + public string? SubjectCode { get; set; } + + public string? VisitName { get; set; } + + public string? StudyCode { get; set; } } public class BatchAddSyncFileCommand diff --git a/IRaCIS.Core.Application/Service/Common/FileUploadRecordService.cs b/IRaCIS.Core.Application/Service/Common/FileUploadRecordService.cs index 2d7f4dcdb..e6dfeee43 100644 --- a/IRaCIS.Core.Application/Service/Common/FileUploadRecordService.cs +++ b/IRaCIS.Core.Application/Service/Common/FileUploadRecordService.cs @@ -96,6 +96,8 @@ public class FileUploadRecordService(IRepository _fileUploadRe .WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId) .WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectVisitId == inQuery.SubjectVisitId) .WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode)) + .WhereIf(!string.IsNullOrEmpty(inQuery.VisitName), t => t.SubjectVisit.VisitName.Contains(inQuery.VisitName)) + .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode)) .WhereIf(inQuery.DataFileType == 1 && inQuery.SubjectId != null && inQuery.SubjectVisitId == null, t => t.SubjectVisitId == null) .WhereIf(inQuery.DataFileType == 1 && inQuery.SubjectVisitId != null && inQuery.StudyCode.IsNullOrEmpty(), t => t.StudyCode == "") @@ -137,7 +139,9 @@ public class FileUploadRecordService(IRepository _fileUploadRe var fileUploadRecordQueryable = _uploadFileSyncRecordRepository .WhereIf(inQuery.FileUploadRecordId != null, t => t.FileUploadRecordId == inQuery.FileUploadRecordId) - + .WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.FileUploadRecord.StudyCode.Contains(inQuery.StudyCode)) + .WhereIf(!string.IsNullOrEmpty(inQuery.VisitName), t => t.FileUploadRecord.SubjectVisit.VisitName.Contains(inQuery.VisitName)) + .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.FileUploadRecord.Subject.Code.Contains(inQuery.SubjectCode)) .ProjectTo(_mapper.ConfigurationProvider);