diff --git a/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs b/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs index 94071da3a..43dbb6439 100644 --- a/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs @@ -14,11 +14,11 @@ namespace IRaCIS.Application.Services [ApiExplorerSettings(GroupName = "Reviewer")] public class AttachmentService : BaseService, IAttachmentService { - private readonly IRepository attachmentrepository; + private readonly IRepository _attachmentrepository; public AttachmentService(IRepository attachmentrepository) { - this.attachmentrepository = attachmentrepository; + this._attachmentrepository = attachmentrepository; } /// @@ -42,7 +42,7 @@ namespace IRaCIS.Application.Services // File.Delete(temp); //} - var success =await attachmentrepository.DeleteFromQueryAsync(a => a.Id == param.Id); + var success =await _attachmentrepository.DeleteFromQueryAsync(a => a.Id == param.Id); return ResponseOutput.Result(success); } @@ -56,7 +56,7 @@ namespace IRaCIS.Application.Services [HttpGet("{doctorId:guid}/{type}")] public async Task> GetAttachmentByType(Guid doctorId, string type) { - var attachmentList = await attachmentrepository.Where(a => a.DoctorId == doctorId && a.Type.Equals(type)).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var attachmentList = await _attachmentrepository.Where(a => a.DoctorId == doctorId && a.Type.Equals(type)).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); return attachmentList; @@ -72,7 +72,7 @@ namespace IRaCIS.Application.Services public async Task> GetAttachmentByTypes(Guid doctorId, string[] types) { - var attachmentList =await attachmentrepository.Where(a => a.DoctorId == doctorId && types.Contains(a.Type)).OrderBy(s => s.Type).ThenBy(m => m.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var attachmentList =await _attachmentrepository.Where(a => a.DoctorId == doctorId && types.Contains(a.Type)).OrderBy(s => s.Type).ThenBy(m => m.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); return attachmentList; @@ -86,7 +86,7 @@ namespace IRaCIS.Application.Services [HttpGet("{doctorId:guid}")] public async Task> GetAttachments(Guid doctorId) { - var attachmentList =await attachmentrepository.Where(a => a.DoctorId == doctorId).OrderBy(s => s.Type).ThenBy(m => m.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var attachmentList =await _attachmentrepository.Where(a => a.DoctorId == doctorId).OrderBy(s => s.Type).ThenBy(m => m.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); return attachmentList; @@ -95,7 +95,7 @@ namespace IRaCIS.Application.Services [NonDynamicMethod] public async Task GetDetailById(Guid attachmentId) { - var attachment = await attachmentrepository.FirstOrDefaultAsync(a => a.Id == attachmentId).IfNullThrowException(); + var attachment = await _attachmentrepository.FirstOrDefaultAsync(a => a.Id == attachmentId).IfNullThrowException(); var temp= _mapper.Map(attachment); temp.FullPath = temp.Path + "?access_token=" + _userInfo.UserToken; return temp; @@ -139,7 +139,7 @@ namespace IRaCIS.Application.Services //重传的时候,发现 相同语言的官方简历数量为2 那么将重传的简历设置为非官方 if (attachments.Count(t => t.Language == reUpload.Language && t.IsOfficial) == 2) { - await attachmentrepository.UpdateFromQueryAsync(t => t.Id == reUpload.Id, u => new Attachment() + await _attachmentrepository.UpdateFromQueryAsync(t => t.Id == reUpload.Id, u => new Attachment() { Path = reUpload.Path, CreateTime = DateTime.Now, @@ -150,7 +150,7 @@ namespace IRaCIS.Application.Services } else //相同语言的重传 { - await attachmentrepository.UpdateFromQueryAsync(t => t.Id == reUpload.Id, u => new Attachment() + await _attachmentrepository.UpdateFromQueryAsync(t => t.Id == reUpload.Id, u => new Attachment() { Path = reUpload.Path, CreateTime = DateTime.Now, @@ -182,7 +182,7 @@ namespace IRaCIS.Application.Services var newAttachment = _mapper.Map(attachment); //如果这个医生不存在 这个语言的官方简历 就设置为官方简历 - if (! await attachmentrepository.AnyAsync(t => t.Type == "Resume" && t.DoctorId == attachment.DoctorId && t.Language == attachment.Language && t.IsOfficial)) + if (! await _attachmentrepository.AnyAsync(t => t.Type == "Resume" && t.DoctorId == attachment.DoctorId && t.Language == attachment.Language && t.IsOfficial)) { newAttachment.IsOfficial = true; @@ -198,7 +198,7 @@ namespace IRaCIS.Application.Services [NonDynamicMethod] public async Task GetDoctorOfficialCV(int language, Guid doctorId) { - var result = await attachmentrepository.FirstOrDefaultAsync(a => a.DoctorId == doctorId && + var result = await _attachmentrepository.FirstOrDefaultAsync(a => a.DoctorId == doctorId && a.IsOfficial && a.Type.Equals("Resume") && a.Language == language); if (result != null) { @@ -241,7 +241,7 @@ namespace IRaCIS.Application.Services [HttpPost("{doctorId:guid}/{attachmentId:guid}/{language}")] public async Task SetLanguage(Guid doctorId, Guid attachmentId, int language) { - bool result =await attachmentrepository.UpdateFromQueryAsync(t => t.Id == attachmentId, a => new Attachment + bool result =await _attachmentrepository.UpdateFromQueryAsync(t => t.Id == attachmentId, a => new Attachment { Language = language, IsOfficial = false diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs b/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs index 766c2aa87..5204678af 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs @@ -109,6 +109,9 @@ namespace IRaCIS.Application.Contracts public int? InPlanVisitCount { get; set; } public int? InPlanVisitSubmmitCount { get; set; } + public string FinalSubjectVisitName { get; set; } + + public int? MissingSubmmitCount { get; set; } public int? LostVisitCount { get; set; } diff --git a/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs b/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs index 67da4d778..0e885dead 100644 --- a/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs @@ -51,6 +51,7 @@ namespace IRaCIS.Core.Application.Service //.ForMember(d => d.InPlanNoneDicomStudyUploadCount, u => u.MapFrom(s => s.SubjectVisitList.Where(t => t.InPlan).SelectMany(k => k.NoneDicomStudyList).Count())) //.ForMember(d => d.OutPlanNoneDicomStudyUploadCount, u => u.MapFrom(s => s.SubjectVisitList.Where(t => t.InPlan == false).SelectMany(k => k.NoneDicomStudyList).Count())) .ForMember(d => d.FinalSubjectVisitId, u => u.MapFrom(s => s.SubjectVisitList.Where(t => t.IsFinalVisit).Select(c=>(Guid?) c.Id).FirstOrDefault())) + .ForMember(d => d.FinalSubjectVisitName, u => u.MapFrom(s => s.SubjectVisitList.Where(t => t.IsFinalVisit).Select(c => c.VisitName).FirstOrDefault())) .ForMember(d => d.InPlanVisitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.InPlan))) .ForMember(d => d.OutPlanVisitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.InPlan == false))) //执行不一定上传了 可能是失访 实际执行过了 diff --git a/IRaCIS.Core.Domain/Visit/Subject.cs b/IRaCIS.Core.Domain/Visit/Subject.cs index 62402e241..e5e88a105 100644 --- a/IRaCIS.Core.Domain/Visit/Subject.cs +++ b/IRaCIS.Core.Domain/Visit/Subject.cs @@ -13,10 +13,12 @@ namespace IRaCIS.Core.Domain.Models { public List SubjectVisitList { get; set; } = new List(); - //受试者有TrialId SiteId - //public List TrialSiteUserList { get; set; } = new List(); + //public List LastSubjectVisit { get; set; } = SubjectVisitList.where; + + //受试者有TrialId SiteId + //public List TrialSiteUserList { get; set; } = new List(); + - //需要配置是两个键连接 public TrialSite TrialSite { get; set; }