diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteViewModel.cs index 078b18829..d452e4982 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteViewModel.cs @@ -38,9 +38,11 @@ namespace IRaCIS.Core.Application.Contracts.DTO public class TrialSiteCommand { public Guid TrialId { get; set; } - public Guid SiteId { get; set; } + public Guid? SiteId { get; set; } - public string SiteName { get; set; } + public string TrialSiteName { get; set; } = String.Empty; + + public string TrialSiteAliasName { get; set; } = String.Empty; public bool IsDeleted { get; set; } = true; diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs index 7c5996cef..3355f2d4a 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs @@ -42,7 +42,6 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap() - .ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.SiteName)) .ForMember(x => x.Id, x => x.Ignore()); CreateMap(); diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 7230e193f..37793e6d0 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -482,7 +482,7 @@ namespace IRaCIS.Core.Application.Services { var result = new List(); - var thisRowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new + var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new { x.ReadingQuestionTrial.ShowOrder, x.RowIndex, @@ -497,9 +497,9 @@ namespace IRaCIS.Core.Application.Services if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned) { - var thisStudyIds = thisRowinfo.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.StudyId).Distinct().ToList(); - var thisSeriesIdIds = thisRowinfo.Where(x => x.SeriesId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.SeriesId).Distinct().ToList(); - if (thisRowinfo.Count > 0) + var thisStudyIds = rowInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.StudyId).Distinct().ToList(); + var thisSeriesIdIds = rowInfoList.Where(x => x.SeriesId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.SeriesId).Distinct().ToList(); + if (rowInfoList.Count > 0) { var thisVisitTaskStudy = await _repository.Where(t => thisStudyIds.Contains(t.Id)).Select(k => new VisitStudyDTO() { @@ -523,7 +523,7 @@ namespace IRaCIS.Core.Application.Services { item.SeriesInstanceUid = string.Empty; - var markInstanceIdList = thisRowinfo.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList(); + var markInstanceIdList = rowInfoList.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList(); item.InstanceInfoList = await _repository.Where(t => markInstanceIdList.Contains(t.Id)).OrderBy(t => t.InstanceNumber).Select(k => new InstanceBasicInfo() @@ -539,7 +539,7 @@ namespace IRaCIS.Core.Application.Services item.InstanceInfoList.ForEach(x => { - var item = thisRowinfo.FirstOrDefault(y => y.InstanceId == x.Id); + var item = rowInfoList.FirstOrDefault(y => y.InstanceId == x.Id); if (item != null) { x.ShowOrder = item.ShowOrder; @@ -600,9 +600,8 @@ namespace IRaCIS.Core.Application.Services List seriesLists = await _repository.Where(s => studyIds.Contains(s.StudyId) /*&& s.IsReading*/) .WhereIf(isManualGenerate == false, t => t.IsReading) .WhereIf(isManualGenerate, t => t.SubjectCriteriaEvaluationVisitStudyFilterList.Any(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsConfirmed && t.IsReading)) - .OrderBy(s => s.SeriesNumber). - ThenBy(s => s.SeriesTime) - .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + .OrderBy(s => s.SeriesNumber). ThenBy(s => s.SeriesTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + foreach (var t in studyList) { t.SeriesList = seriesLists.Where(s => s.StudyId == t.StudyId).OrderBy(s => s.SeriesNumber). @@ -692,7 +691,7 @@ namespace IRaCIS.Core.Application.Services { x.SeriesList.ForEach(y => { - y.IsBeMark = thisRowinfo.Any(z => z.SeriesId == y.Id); + y.IsBeMark = rowInfoList.Any(z => z.SeriesId == y.Id); }); });