diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index b3f13a70b..c73aa2032 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -3,6 +3,7 @@ using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Service.Inspection.DTO; using IRaCIS.Core.Application.Service.Inspection.Interface; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infrastructure; using Panda.DynamicWebApi.Attributes; @@ -58,8 +59,11 @@ 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 visttask in _repository.GetQueryable().IgnoreQueryFilters() on data.VisitTaskId equals visttask.Id into visttasktemp + from leftvisttask in visttasktemp.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 @@ -131,7 +135,7 @@ namespace IRaCIS.Core.Application.Service.Inspection ExperimentName = leftrial.ExperimentName, - SubjectCode = leftsubject.Code, + SubjectCode = leftvisttask.BlindSubjectCode.IsNullOrEmpty()? leftsubject.Code: leftvisttask.BlindSubjectCode, SiteCode = lefttrialSite.TrialSiteCode, ResearchProgramNo = leftrial.ResearchProgramNo,