diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index 629cccaa4..9404c7c89 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -345,7 +345,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public class GetDataInspectionOutDto : DataInspection { - + public string TrialReadingCriterionName { get; set; } public string BlindName { get; set; } //public string FirstName { get; set; } = string.Empty; @@ -487,6 +487,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public Guid? ObjectRelationParentId { get; set; } + public Guid? TrialReadingCriterionId { get; set; } + } diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index e3ca780cb..8e9b57a4c 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -59,6 +59,9 @@ namespace IRaCIS.Core.Application.Service.Inspection join usertype in _repository.GetQueryable().IgnoreQueryFilters() on leftuser.UserTypeId equals usertype.Id into usertypetemp from leftusertype in usertypetemp.DefaultIfEmpty() + join trialCriterion in _repository.GetQueryable().IgnoreQueryFilters() on data.TrialReadingCriterionId equals trialCriterion.Id into criterion + from leftCriterion in criterion.DefaultIfEmpty() + //join moduleTyped in _repository.GetQueryable().Where(x => x.Code == "ModuleType") on 1 equals 1 //join moduleTypec in _repository.GetQueryable() on new { ParentId = moduleTyped.Id, ModuleType = data.ModuleType } equals new { ParentId = moduleTypec.ParentId.Value, ModuleType = moduleTypec.Value } into moduleTypectemp @@ -146,7 +149,9 @@ namespace IRaCIS.Core.Application.Service.Inspection BatchId = data.BatchId, OptType = leftOptType.Value, ObjectRelationParentId = data.ObjectRelationParentId, - GeneralId = data.GeneralId + GeneralId = data.GeneralId, + + TrialReadingCriterionName= leftCriterion.CriterionName }; query = query.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId) @@ -170,7 +175,8 @@ namespace IRaCIS.Core.Application.Service.Inspection #endregion .WhereIf(dto.BatchId != null, x => x.BatchId == dto.BatchId) .WhereIf(dto.BatchId == null && dto.GeneralId != null, x => x.GeneralId == dto.GeneralId) - + .WhereIf(dto.TrialReadingCriterionId == null, x => x.TrialReadingCriterionId == dto.TrialReadingCriterionId) + .WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo)) //.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo)