From 1778d454811a6481424d0391867a1ac47460e71a Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 26 Aug 2024 14:05:16 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E9=87=8C=E9=9D=A2=E6=97=B6=E9=97=B4=E6=97=B6=E5=8C=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Helper/FileStoreHelper.cs | 2 +- .../Service/QC/DTO/QCListViewModel.cs | 68 +++++++++++-------- .../Service/QC/_MapConfig.cs | 65 +++++++++++------- 3 files changed, 80 insertions(+), 55 deletions(-) diff --git a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs index 55c01d7f0..ed371698a 100644 --- a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs @@ -136,7 +136,7 @@ public static class FileStoreHelper { var doc = await _commonDocumentRepository.FirstOrDefaultAsync(t => t.Code == code); - var isEn_US = CultureInfo.CurrentCulture.Name!= "zh-CN"; + var isEn_US = CultureInfo.CurrentCulture.Name!= StaticData.CultureInfo.zh_CN; if (doc == null) { //---数据库没有找到对应的数据模板文件,请联系系统运维人员。 diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index cfe46e64f..cea1ddb9d 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -1,4 +1,5 @@ -using IRaCIS.Core.Application.Contracts.DTO; +using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson; +using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; @@ -8,6 +9,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Web; +using static MassTransit.ValidationResultExtensions; namespace IRaCIS.Core.Application.Contracts { @@ -36,8 +38,8 @@ namespace IRaCIS.Core.Application.Contracts { public Guid TrialId { get; set; } - public Guid? VisitId { get; set; } - } + public Guid? VisitId { get; set; } + } public class QCVisitSearchDTO : PageInput { @@ -54,8 +56,8 @@ namespace IRaCIS.Core.Application.Contracts public Guid TrialId { get; set; } public Guid? TrialSiteId { get; set; } - public Guid? VisitId { get; set; } - public Guid? SubjectId { get; set; } + public Guid? VisitId { get; set; } + public Guid? SubjectId { get; set; } public string SubjectInfo { get; set; } = String.Empty; @@ -132,7 +134,7 @@ namespace IRaCIS.Core.Application.Contracts - public string OutEnrollmentVisitName { get; set; } = String.Empty; + public string OutEnrollmentVisitName { get; set; } = String.Empty; public string BodyPartTypes { get; set; } = String.Empty; @@ -211,7 +213,7 @@ namespace IRaCIS.Core.Application.Contracts //临床数据收集 - public string ClinicalDataCollect => $"{DicomStudyCount},{NoneDicomStudyCount}{(IsBaseLine? (ClinicalInformationTransmissionEnum>0 && IsHaveClinicalData ? ",w/" : ",w/o") :"" )}"; + public string ClinicalDataCollect => $"{DicomStudyCount},{NoneDicomStudyCount}{(IsBaseLine ? (ClinicalInformationTransmissionEnum > 0 && IsHaveClinicalData ? ",w/" : ",w/o") : "")}"; public int? DicomStudyCount { get; set; } public int? NoneDicomStudyCount { get; set; } @@ -257,7 +259,7 @@ namespace IRaCIS.Core.Application.Contracts } - public class QCVisitExportDTO: CRCVisitExportDTO + public class QCVisitExportDTO : CRCVisitExportDTO { //上传人 public string SubmitUserRealName { get; set; } @@ -317,10 +319,9 @@ namespace IRaCIS.Core.Application.Contracts [DictionaryTranslateAttribute("ReuploadEnum")] public QCChanllengeReuploadEnum ReuploadEnum { get; set; } + public List DialogList { get; set; } - - - public string DialogStr { get; set; } + public string DialogStr => string.Join("\n\n", DialogList.OrderBy(t => t.CreateTime).Select(c => c.UserName + " (" + ExportExcelConverterDate.DateTimeInternationalToString(c.CreateTime) + ") :" + c.Content)); //public SubmitStateEnum SubmitState { get; set; } //public string? CurrentActionUserName { get; set; } @@ -341,6 +342,16 @@ namespace IRaCIS.Core.Application.Contracts } + public class DialogInfo + { + public DateTime CreateTime { get; set; } + + public string UserName { get; set; } + + public string Content { get; set; } + } + + public class SubjectExportDTO { @@ -636,7 +647,7 @@ namespace IRaCIS.Core.Application.Contracts public int FileCount { get; set; } [DictionaryTranslateAttribute("YesOrNo")] - public bool IsSuccess { get; set; } + public bool IsSuccess { get; set; } public string Note { get; set; } = string.Empty; @@ -717,7 +728,8 @@ namespace IRaCIS.Core.Application.Contracts public string CheckResult { get; set; } = String.Empty; - public string CheckDialogStr { get; set; } + public List CheckDialogList { get; set; } + public string CheckDialogStr => string.Join("\n\n", CheckDialogList.OrderBy(t => t.CreateTime).Select(c => c.UserName + " (" + ExportExcelConverterDate.DateTimeInternationalToString(c.CreateTime) + ") :" + c.Content)); public DateTime? CheckBackTime { get; set; } @@ -792,7 +804,7 @@ namespace IRaCIS.Core.Application.Contracts { - + public string? ReReadingNewTaskCode { get; set; } @@ -988,7 +1000,7 @@ namespace IRaCIS.Core.Application.Contracts public Guid VisitTaskId { get; set; } public string Answer { get; set; } - + } @@ -1218,17 +1230,17 @@ namespace IRaCIS.Core.Application.Contracts public class GetNextCRCChallengeInDto { - [NotDefault] - public Guid TrialId { get; set; } + [NotDefault] + public Guid TrialId { get; set; } - /// - /// QCChallengeId - /// - public Guid QCChallengeId { get; set; } - } + /// + /// QCChallengeId + /// + public Guid QCChallengeId { get; set; } + } - public class ChallengeQuery : PageInput + public class ChallengeQuery : PageInput { [NotDefault] public Guid TrialId { get; set; } @@ -1247,7 +1259,7 @@ namespace IRaCIS.Core.Application.Contracts public Guid? CreateUserId { get; set; } - } + } public class QCCRCChallengeViewModel { @@ -1438,7 +1450,7 @@ namespace IRaCIS.Core.Application.Contracts public List DialogList { get; set; } } - public class QCCheckWithModalityView: QCCheckViewModel + public class QCCheckWithModalityView : QCCheckViewModel { public DateTime? EarliestScanDate { get; set; } @@ -1446,7 +1458,7 @@ namespace IRaCIS.Core.Application.Contracts public List ModalityList { get; set; } - public string Modalitys =>string.Join(',', ModalityList); + public string Modalitys => string.Join(',', ModalityList); } public class QCCheckViewModel @@ -1589,7 +1601,7 @@ namespace IRaCIS.Core.Application.Contracts public bool IsLostVisit { get; set; } - public string VisitImageZipPath { get; set; } + public string VisitImageZipPath { get; set; } public PackState PackState { get; set; } @@ -1599,7 +1611,7 @@ namespace IRaCIS.Core.Application.Contracts public DateTime? PreliminaryAuditTime { get; set; } - public DateTime? AuditTime => QCProcessEnum == TrialQCProcess.SingleAudit ? PreliminaryAuditTime : (QCProcessEnum == TrialQCProcess.DoubleAudit ? ReviewAuditTime : null); + public DateTime? AuditTime => QCProcessEnum == TrialQCProcess.SingleAudit ? PreliminaryAuditTime : (QCProcessEnum == TrialQCProcess.DoubleAudit ? ReviewAuditTime : null); } diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 292e159cb..3ad2ace1a 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -26,11 +26,11 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code)) .ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.FullName)) .ForMember(d => d.ClinicalInformationTransmissionEnum, u => u.MapFrom(s => s.Trial.ClinicalInformationTransmissionEnum)) - + .ForMember(d => d.IsHaveClinicalData, u => u.MapFrom(t => t.IsBaseLine ? t.PreviousHistoryList.Any() || t.PreviousOtherList.Any() || t.ReadingClinicalDataList.Any(x => x.ClinicalDataTrialSet.UploadRole == Domain.Share.UploadRole.CRC && x.ReadingClinicalDataPDFList.Count > 0) || t.PreviousSurgeryList.Any() : false)) - + .ForMember(d => d.DicomStudyCount, u => u.MapFrom(t => t.StudyList.Count())) .ForMember(d => d.NoneDicomStudyCount, u => u.MapFrom(t => t.NoneDicomStudyList.Count(t => t.NoneDicomFileList.Any()))); @@ -40,9 +40,12 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.CurrentActionUserName, u => u.MapFrom(s => s.CurrentActionUser.UserName)) .ForMember(d => d.PreliminaryAuditUserName, u => u.MapFrom(s => s.PreliminaryAuditUser.UserName)) .ForMember(d => d.ReviewAuditUserName, u => u.MapFrom(s => s.ReviewAuditUser.UserName)); - + CreateMap() + .ForMember(d => d.CreateTime, u => u.MapFrom(s => s.CreateTime)) + .ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName)) + .ForMember(d => d.Content, u => u.MapFrom(s => s.TalkContent)); CreateMap() @@ -53,7 +56,10 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUser.UserName)) .ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName)) - .ForMember(d => d.DialogStr, u => u.MapFrom(t => string.Join("\n\n", t.DialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " (" + c.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") + ") :" + c.TalkContent)))) + .ForMember(d => d.DialogList, u => u.MapFrom(t => t.DialogList)) + + //.ForMember(d => d.DialogStr, u => u.MapFrom(t => string.Join("\n\n", t.DialogList.OrderBy(t => t.CreateTime) + //.Select(c => c.CreateUser.UserName + " (" + c.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") + ") :" + c.TalkContent)))) .ForMember(d => d.SubjectState, u => u.MapFrom(s => s.SubjectVisit.Subject.Status)); @@ -96,7 +102,7 @@ namespace IRaCIS.Core.Application.Service // .ForMember(d => d.ReadingStatus, u => u.MapFrom(s => s.VisitTaskList // .Count(t=>t.TaskState==TaskState.Effect && t.IsAnalysisCreate==false && t.ReadingCategory==ReadingCategory.Visit && t.ReadingTaskState==ReadingTaskState.HaveSigned)==s. s.ReadingStatus)) - + @@ -111,13 +117,20 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.FirstGiveMedicineTime, u => u.MapFrom(s => s.Subject.FirstGiveMedicineTime)) .ForMember(d => d.TrialReadingCriterionName, u => u.MapFrom(s => s.TrialReadingCriterion.CriterionName)); + CreateMap() + .ForMember(d => d.CreateTime, u => u.MapFrom(s => s.CreateTime)) + .ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName)) + .ForMember(d => d.Content, u => u.MapFrom(s => s.TalkContent)); CreateMap() .ForMember(d => d.TalkContent, u => u.MapFrom(s => s.CheckChallengeDialogList.OrderByDescending(y => y.CreateTime).Select(x => x.TalkContent).FirstOrDefault())) .ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code)) .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode)) - .ForMember(d => d.CheckDialogStr, u => u.MapFrom(t => string.Join("\n\n", t.CheckChallengeDialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " (" + c.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") + ") :" + c.TalkContent)))) + .ForMember(d => d.CheckDialogList, u => u.MapFrom(s => s.CheckChallengeDialogList)) + //.ForMember(d => d.CheckDialogStr, u => u.MapFrom(t => string.Join("\n\n", + //t.CheckChallengeDialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " (" + c.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") + ") :" + c.TalkContent)))) + .ForMember(d => d.ModalityList, c => c.MapFrom(s => (s.NoneDicomStudyList.Select(t => t.Modality) .Union(s.StudyList.Select(k => k.ModalityForEdit))).Distinct())) @@ -155,13 +168,13 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.VisitTask.Subject.MedicalNo)) .ForMember(o => o.DoctorUserName, t => t.MapFrom(u => u.VisitTask.DoctorUser.UserName)) .ForMember(o => o.MedicalManagerUserName, t => t.MapFrom(u => u.MedicalManagerUser.UserName)) - .ForMember(o => o.QuestionContent, t => t.MapFrom(u=> string.Join("\n\n", u.ReadingMedicalReviewDialogList.Where(t => t.IsHaveQuestion).Select(t=>t.Questioning))) ); + .ForMember(o => o.QuestionContent, t => t.MapFrom(u => string.Join("\n\n", u.ReadingMedicalReviewDialogList.Where(t => t.IsHaveQuestion).Select(t => t.Questioning)))); CreateMap() .ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.IsSelfAnalysis == true ? u.BlindTrialSiteCode : u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.IsSelfAnalysis == true ? u.BlindSubjectCode : u.Subject.Code)) - + ; @@ -173,8 +186,8 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)) .ForMember(o => o.IsBaseline, t => t.MapFrom(u => u.SourceSubjectVisit.IsBaseLine)) .ForMember(o => o.EvaluateResult, t => t.MapFrom(u => - u.SourceSubjectVisit.IsBaseLine? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.ExistDisease).FirstOrDefault()!.Answer - : u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).FirstOrDefault()!.Answer )) + u.SourceSubjectVisit.IsBaseLine ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.ExistDisease).FirstOrDefault()!.Answer + : u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).FirstOrDefault()!.Answer)) .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)); @@ -191,15 +204,15 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.JudgeArmEnum, t => t.MapFrom(u => u.JudgeResultTask.ArmEnum)) .ForMember(o => o.OverallTumorEvaluationResult, t => t.MapFrom(u => - criterionType == CriterionType.RECIST1Point1 ?( u.SourceSubjectVisit.IsBaseLine==true ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.ExistDisease).FirstOrDefault()!.Answer: - u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).Select(t=>t.IsGlobalChange?t.GlobalChangeAnswer:t.Answer).FirstOrDefault()) + criterionType == CriterionType.RECIST1Point1 ? (u.SourceSubjectVisit.IsBaseLine == true ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.ExistDisease).FirstOrDefault()!.Answer : + u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).Select(t => t.IsGlobalChange ? t.GlobalChangeAnswer : t.Answer).FirstOrDefault()) : criterionType == CriterionType.PCWG3 ? u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.SiteVisitForTumorEvaluation).FirstOrDefault()!.Answer : String.Empty )) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)) .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)) - //.ForMember(o => o.GlobalTaskAnswerList, t => t.MapFrom(u => u.GlobalVisitResultList.Where(t=>t.GlobalAnswerType== GlobalAnswerType.Question).Select(c=>new GlobalAnswerInfo() { GlobalTaskVisitNum=c.VisitTask.VisitTaskNum,VisitTaskId=c.TaskId ,Answer=c.Answer}))) + //.ForMember(o => o.GlobalTaskAnswerList, t => t.MapFrom(u => u.GlobalVisitResultList.Where(t=>t.GlobalAnswerType== GlobalAnswerType.Question).Select(c=>new GlobalAnswerInfo() { GlobalTaskVisitNum=c.VisitTask.VisitTaskNum,VisitTaskId=c.TaskId ,Answer=c.Answer}))) ; @@ -220,14 +233,14 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(o => o.LessionCode, t => t.MapFrom(u => u.RowMark)) - .ForMember(o => o.LessionType, t => t.MapFrom(u =>(int?) u.ReadingQuestionTrial.LesionType)) + .ForMember(o => o.LessionType, t => t.MapFrom(u => (int?)u.ReadingQuestionTrial.LesionType)) .ForMember(o => o.IsLymph, t => t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.IsLymph).FirstOrDefault()!.Answer)) //位置可能是自己填写的 .ForMember(o => o.LessionLocation, t => //t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Location).FirstOrDefault().Answer) t.MapFrom(u => isEn_Us ? u.OrganInfo.PartEN : u.OrganInfo.Part) - + ) .ForMember(o => o.LessionOrgan, t => //t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Organ).FirstOrDefault().Answer) @@ -239,7 +252,7 @@ namespace IRaCIS.Core.Application.Service //u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Location).FirstOrDefault()!.Answer : isEn_Us ? u.OrganInfo.TULATEN : u.OrganInfo.TULAT) t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.BodyPartDescription).FirstOrDefault()!.Answer) ) - + .ForMember(o => o.LongDiameter, t => t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis).FirstOrDefault()!.Answer)) .ForMember(o => o.ShortDiameter, t => t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis).FirstOrDefault()!.Answer)) .ForMember(o => o.LessionState, t => t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State).FirstOrDefault()!.Answer)); @@ -267,7 +280,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.BodyPartDescription, t => //t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.Part).FirstOrDefault().Answer) t.MapFrom(u => isEn_Us ? u.OrganInfo.PartEN : u.OrganInfo.Part) - ) + ) .ForMember(o => o.LessionState, t => t.MapFrom(u => u.LesionAnswerList.Where(c => c.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State).FirstOrDefault()!.Answer)); #endregion @@ -328,8 +341,8 @@ namespace IRaCIS.Core.Application.Service CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); CreateMap() @@ -385,10 +398,10 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum)) .ForMember(d => d.SubjectStatus, u => u.MapFrom(s => s.Subject.Status)) .ForMember(d => d.StudyCount, u => u.MapFrom(s => s.StudyList.Count())) - + .ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.UserName)) .ForMember(d => d.SubmitUserRealName, u => u.MapFrom(s => s.SubmitUser.FullName)) - + .ForMember(d => d.CurrentActionUserName, u => u.MapFrom(s => s.CurrentActionUser.UserName)) .ForMember(d => d.PreliminaryAuditUserName, u => u.MapFrom(s => s.PreliminaryAuditUser.UserName)) .ForMember(d => d.ReviewAuditUserName, u => u.MapFrom(s => s.ReviewAuditUser.UserName)) @@ -412,12 +425,12 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.Sex, u => u.MapFrom(s => s.Subject.Sex)) .ForMember(d => d.Age, u => u.MapFrom(t => t.Subject.Age)) .ForMember(d => d.IsHaveClinicalData, u => u.MapFrom(t => t.PreviousHistoryList.Any() || t.PreviousOtherList.Any() - || t.Subject.ClinicalFormList.Any(x=>x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC&& x.ReadingId==t.Id) + || t.Subject.ClinicalFormList.Any(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == t.Id) || t.ReadingClinicalDataList.Any(x => x.ClinicalDataTrialSet.UploadRole == Domain.Share.UploadRole.CRC && x.ReadingClinicalDataPDFList.Count > 0) || t.PreviousSurgeryList.Any())) - .ForMember(d => d.IsHaveUploadFailed, u => u.MapFrom(t => t.StudyList.SelectMany(c=>c.DicomStudyMonitorList).Any(h => h.FailedFileCount>0) )) - + .ForMember(d => d.IsHaveUploadFailed, u => u.MapFrom(t => t.StudyList.SelectMany(c => c.DicomStudyMonitorList).Any(h => h.FailedFileCount > 0))) + //.ForMember(d => d.VisitName, u => u.MapFrom(t =>t.InPlan? t.VisitStage.VisitName : t.VisitName)) //.ForMember(d => d.VisitNum, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitNum : t.VisitNum)) //.ForMember(d => d.VisitDay, u => u.MapFrom(t => t.InPlan ? t.VisitStage.VisitDay : t.VisitDay)) @@ -436,7 +449,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.ModalityList, c => c.MapFrom(s => (s.NoneDicomStudyList.Select(t => t.Modality) .Union(s.StudyList.Select(k => k.ModalityForEdit))).Distinct())); - + //一致性核查 质疑对话 CreateMap() @@ -581,7 +594,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() //.ForMember(d => d.FileCount, u => u.MapFrom(s => s.NoneDicomFileList.Count)) - .ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip? s.NoneDicomFileList.Where(t=>!t.FileType.Contains(StaticData.FileType.Zip)): s.NoneDicomFileList)) + .ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.NoneDicomFileList.Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.NoneDicomFileList)) .ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode)); From 0acb7ca987600c4f99052ac5541297f7c34cf3ba Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 26 Aug 2024 15:35:02 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E5=BD=B1=E5=83=8F=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 2 +- IRC.Core.SCP/Service/DicomArchiveService.cs | 10 +++++++--- IRC.Core.SCP/Service/Interface/IDicomArchiveService.cs | 2 +- .../Controllers/UploadDownLoadController.cs | 4 ++-- .../Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs | 6 ++++-- .../{QC => ImageAndDoc}/NoneDicomStudyService.cs | 0 IRaCIS.Core.Domain/Image/DicomInstance.cs | 2 ++ IRaCIS.Core.Domain/Image/DicomStudy.cs | 2 ++ IRaCIS.Core.Domain/Image/DicomStudyMonitor.cs | 2 +- .../{QC/NoneDicom => Image}/NoneDicomStudy.cs | 0 .../{QC/NoneDicom => Image}/NoneDicomStudyFile.cs | 2 ++ IRaCIS.Core.Domain/Image/SCPInstance.cs | 2 ++ IRaCIS.Core.Domain/Image/TaskInstance.cs | 2 ++ 13 files changed, 26 insertions(+), 10 deletions(-) rename IRaCIS.Core.Application/Service/{QC => ImageAndDoc}/NoneDicomStudyService.cs (100%) rename IRaCIS.Core.Domain/{QC/NoneDicom => Image}/NoneDicomStudy.cs (100%) rename IRaCIS.Core.Domain/{QC/NoneDicom => Image}/NoneDicomStudyFile.cs (95%) diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index 6cfb381ad..86c09af4e 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -301,7 +301,7 @@ namespace IRaCIS.Core.SCP.Service { try { - var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE); + var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE,fileSize); if (!_SCPStudyIdList.Contains(scpStudyId)) { diff --git a/IRC.Core.SCP/Service/DicomArchiveService.cs b/IRC.Core.SCP/Service/DicomArchiveService.cs index ee456af4a..ac0edd173 100644 --- a/IRC.Core.SCP/Service/DicomArchiveService.cs +++ b/IRC.Core.SCP/Service/DicomArchiveService.cs @@ -12,6 +12,7 @@ using IRaCIS.Core.SCP.Service; using IRaCIS.Core.Infra.EFCore; using MassTransit; using System.Runtime.Intrinsics.X86; +using Serilog.Sinks.File; namespace IRaCIS.Core.SCP.Service { @@ -51,7 +52,7 @@ namespace IRaCIS.Core.SCP.Service /// /// /// - public async Task ArchiveDicomFileAsync(DicomDataset dataset, Guid trialId, Guid trialSiteId, string fileRelativePath, string callingAE, string calledAE) + public async Task ArchiveDicomFileAsync(DicomDataset dataset, Guid trialId, Guid trialSiteId, string fileRelativePath, string callingAE, string calledAE,long fileSize) { string studyInstanceUid = dataset.GetString(DicomTag.StudyInstanceUID); string seriesInstanceUid = dataset.GetString(DicomTag.SeriesInstanceUID); @@ -270,7 +271,10 @@ namespace IRaCIS.Core.SCP.Service WindowCenter = dataset.GetSingleValueOrDefault(DicomTag.WindowCenter, string.Empty), WindowWidth = dataset.GetSingleValueOrDefault(DicomTag.WindowWidth, string.Empty), - Path = fileRelativePath + Path = fileRelativePath, + + FileSize= fileSize, + }; ++findStudy.InstanceCount; @@ -300,7 +304,7 @@ namespace IRaCIS.Core.SCP.Service } else { - await _instanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == instanceId, u => new SCPInstance() { Path = fileRelativePath }); + await _instanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == instanceId, u => new SCPInstance() { Path = fileRelativePath,FileSize=fileSize }); } //await _studyRepository.SaveChangesAsync(); diff --git a/IRC.Core.SCP/Service/Interface/IDicomArchiveService.cs b/IRC.Core.SCP/Service/Interface/IDicomArchiveService.cs index 1c107e94b..99312ef4f 100644 --- a/IRC.Core.SCP/Service/Interface/IDicomArchiveService.cs +++ b/IRC.Core.SCP/Service/Interface/IDicomArchiveService.cs @@ -5,7 +5,7 @@ namespace IRaCIS.Core.SCP.Service { public interface IDicomArchiveService { - Task ArchiveDicomFileAsync(DicomDataset dicomDataset,Guid trialId,Guid trialSiteId, string fileRelativePath,string callingAE,string calledAE); + Task ArchiveDicomFileAsync(DicomDataset dicomDataset,Guid trialId,Guid trialSiteId, string fileRelativePath,string callingAE,string calledAE,long fileSize); } } diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index 2e9f81109..5f25482bc 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -368,7 +368,7 @@ namespace IRaCIS.Core.API.Controllers throw new BusinessValidationFailedException(_localizer["UploadDownLoad_RequestError"]); } - studyMonitor.FileSize = (decimal)HttpContext.Request.ContentLength; + studyMonitor.FileSize = (long)HttpContext.Request.ContentLength; studyMonitor.FileCount = archiveResult.ReceivedFileCount; studyMonitor.FailedFileCount = archiveResult.ErrorFiles.Count; studyMonitor.IsDicomReUpload = archiveStudyCommand.AbandonStudyId != null; @@ -471,7 +471,7 @@ namespace IRaCIS.Core.API.Controllers foreach (var item in incommand.UploadedFileList) { - await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType }); + await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType,FileSize=item.FileFize }); } var uploadFinishedTime = DateTime.Now; diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs index 24982f635..be29c21d3 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs @@ -184,7 +184,7 @@ namespace IRaCIS.Core.Application.Contracts [NotDefault] public Guid SubjectVisitId { get; set; } - public decimal FileSize { get; set; } + public long FileSize { get; set; } public bool IsDicomReUpload { get; set; } @@ -206,7 +206,7 @@ namespace IRaCIS.Core.Application.Contracts public Guid SubjectVisitId { get; set; } - public decimal FileSize { get; set; } + public long FileSize { get; set; } public bool IsDicomReUpload { get; set; } @@ -360,5 +360,7 @@ namespace IRaCIS.Core.Application.Contracts public string Path { get; set; } = string.Empty; public string HtmlPath { get; set; } = string.Empty; + + public decimal FileFize { get; set; } } } diff --git a/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs similarity index 100% rename from IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs rename to IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs diff --git a/IRaCIS.Core.Domain/Image/DicomInstance.cs b/IRaCIS.Core.Domain/Image/DicomInstance.cs index 758ff13cf..3096a0046 100644 --- a/IRaCIS.Core.Domain/Image/DicomInstance.cs +++ b/IRaCIS.Core.Domain/Image/DicomInstance.cs @@ -53,5 +53,7 @@ namespace IRaCIS.Core.Domain.Models public string HtmlPath { get; set; }=string.Empty; + public long? FileSize { get; set; } + } } diff --git a/IRaCIS.Core.Domain/Image/DicomStudy.cs b/IRaCIS.Core.Domain/Image/DicomStudy.cs index b17d275b1..ede2cf307 100644 --- a/IRaCIS.Core.Domain/Image/DicomStudy.cs +++ b/IRaCIS.Core.Domain/Image/DicomStudy.cs @@ -93,6 +93,8 @@ namespace IRaCIS.Core.Domain.Models public bool IsFromPACS { get; set; } + + } } diff --git a/IRaCIS.Core.Domain/Image/DicomStudyMonitor.cs b/IRaCIS.Core.Domain/Image/DicomStudyMonitor.cs index dc83b79f4..29d084dbe 100644 --- a/IRaCIS.Core.Domain/Image/DicomStudyMonitor.cs +++ b/IRaCIS.Core.Domain/Image/DicomStudyMonitor.cs @@ -61,7 +61,7 @@ namespace IRaCIS.Core.Domain.Models public int FailedFileCount { get; set; } - public decimal FileSize { get; set; } + public long FileSize { get; set; } public string IP { get; set; } diff --git a/IRaCIS.Core.Domain/QC/NoneDicom/NoneDicomStudy.cs b/IRaCIS.Core.Domain/Image/NoneDicomStudy.cs similarity index 100% rename from IRaCIS.Core.Domain/QC/NoneDicom/NoneDicomStudy.cs rename to IRaCIS.Core.Domain/Image/NoneDicomStudy.cs diff --git a/IRaCIS.Core.Domain/QC/NoneDicom/NoneDicomStudyFile.cs b/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs similarity index 95% rename from IRaCIS.Core.Domain/QC/NoneDicom/NoneDicomStudyFile.cs rename to IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs index 138bf1427..199aad976 100644 --- a/IRaCIS.Core.Domain/QC/NoneDicom/NoneDicomStudyFile.cs +++ b/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs @@ -31,6 +31,8 @@ namespace IRaCIS.Core.Domain.Models public string FileType { get; set; } + public decimal? FileSize { get; set; } + } } diff --git a/IRaCIS.Core.Domain/Image/SCPInstance.cs b/IRaCIS.Core.Domain/Image/SCPInstance.cs index 115656f04..844283149 100644 --- a/IRaCIS.Core.Domain/Image/SCPInstance.cs +++ b/IRaCIS.Core.Domain/Image/SCPInstance.cs @@ -46,6 +46,8 @@ namespace IRaCIS.Core.Domain.Models public bool Anonymize { get; set; } public string Path { get; set; } = string.Empty; + public long? FileSize { get; set; } + } diff --git a/IRaCIS.Core.Domain/Image/TaskInstance.cs b/IRaCIS.Core.Domain/Image/TaskInstance.cs index ea1035483..7276c500b 100644 --- a/IRaCIS.Core.Domain/Image/TaskInstance.cs +++ b/IRaCIS.Core.Domain/Image/TaskInstance.cs @@ -52,5 +52,7 @@ namespace IRaCIS.Core.Domain.Models public string HtmlPath { get; set; }=string.Empty; + public long? FileSize { get; set; } + } } From f52b09e5e82dac316785cfb2167cdbd4bc303c41 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 26 Aug 2024 16:24:46 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E5=BA=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NewtonsoftJson/NewtonsoftJsonSetup.cs | 2 +- .../NewtonsoftJson/ObjectStorePathConvert.cs | 6 ++---- .../_IRaCIS/IQueryablePageListExtensions.cs | 4 ++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs index 9671fffca..69032ff19 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs @@ -14,7 +14,7 @@ namespace IRaCIS.Core.API { services.AddHttpContextAccessor(); services.AddScoped(); - services.AddScoped(); + services.AddScoped(); services.AddScoped(); builder.AddNewtonsoftJson(options => diff --git a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/ObjectStorePathConvert.cs b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/ObjectStorePathConvert.cs index b9df7af84..e7d4aad48 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/ObjectStorePathConvert.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/ObjectStorePathConvert.cs @@ -9,15 +9,13 @@ using System.Text.RegularExpressions; namespace IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson { - public class CustomStringConverter : JsonConverter + public class ObjectStorePathConvert : JsonConverter { - //private readonly IHttpContextAccessor _httpContextAccessor; private readonly IOSSService _oSSService; // 构造函数 - public CustomStringConverter(/*IHttpContextAccessor httpContextAccessor*/ IOSSService oSSService) + public ObjectStorePathConvert( IOSSService oSSService) { - //_httpContextAccessor = httpContextAccessor; _oSSService = oSSService; } diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs index 5fdbf8e2c..f423446c4 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs @@ -140,6 +140,10 @@ namespace IRaCIS.Core.Infrastructure.Extention { propName = sortField; } + else + { + propName= pageInput.SortField; + } source = string.IsNullOrWhiteSpace(propName) ? source : (pageInput.Asc ? source.OrderBy(propName) : source.OrderBy(propName + " desc")); From 7164a53267c0d8fe9dd30ec75d8195288601d162 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 27 Aug 2024 09:46:20 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E5=8A=A0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/DTO/FrontAuditConfigViewModel.cs | 7 +++++++ IRaCIS.Core.Domain/Common/FrontAuditConfig.cs | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs index 11194fc09..19575e63c 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs @@ -268,6 +268,13 @@ namespace IRaCIS.Core.Application.ViewModel public string ForeignKeyText { get; set; } = string.Empty; + + /// + /// 英文的翻译 + /// + public string ForeignKeyEnText { get; set; } = string.Empty; + + /// /// 接口名 /// diff --git a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs index 9ab746cba..858d8a4db 100644 --- a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs +++ b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs @@ -130,7 +130,10 @@ namespace IRaCIS.Core.Domain.Models /// 字典 public string ForeignKeyText { get; set; } = String.Empty; - + /// + /// 英文的翻译 + /// + public string ForeignKeyEnText { get; set; } = string.Empty; public string TableConfigJsonStr { get; set; } = String.Empty; @@ -183,11 +186,15 @@ namespace IRaCIS.Core.Domain.Models public string ListName { get; set; } = String.Empty; public bool IsFixedColumn { get; set; } public string FixedColumnName { get; set; } = String.Empty; + + public string FixedColumnEnName { get; set; } = String.Empty; public string ColumnName { get; set; } = String.Empty; public string ColumnValue { get; set; } = String.Empty; public bool IsMerge { get; set; } public string MergeColumnName { get; set; } = String.Empty; + public string MergeColumnEnName { get; set; } = String.Empty; + public bool IsPicture { get; set; } From 633abdf0f406ca50c90803850e80af7beeeb6200 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 27 Aug 2024 14:47:20 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ExtraController.cs | 10 +- .../NewtonsoftJson/CustomJsonResult .cs | 125 +++++++++++++++ .../NewtonsoftJson/JSONTimeZoneConverter.cs | 45 ++++-- .../NewtonsoftJson/NewtonsoftJsonSetup.cs | 27 ++-- .../ImageAndDoc/DTO/UnionStudyViewDodel.cs | 19 ++- .../ImageAndDoc/DownloadAndUploadService.cs | 143 +++++++++++++++++- .../Image/NoneDicomStudyFile.cs | 19 ++- IRaCIS.Core.Domain/Trial/Trial.cs | 2 +- 8 files changed, 359 insertions(+), 31 deletions(-) create mode 100644 IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/CustomJsonResult .cs diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index 3c9875df9..7cbff77f7 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -362,8 +362,11 @@ namespace IRaCIS.Api.Controllers var client = new Client(new AlibabaCloud.OpenApiClient.Models.Config() { - AccessKeyId = ossOptions.accessKeyId, - AccessKeySecret = ossOptions.accessKeySecret, + //AccessKeyId = ossOptions.accessKeyId, + //AccessKeySecret = ossOptions.accessKeySecret, + AccessKeyId = "LTAI5tJV76pYX5yPg1N9QVE8", + AccessKeySecret = "roRNLa9YG1of4pYruJGCNKBXEWTAWa", + Endpoint = "sts.cn-hangzhou.aliyuncs.com" }); @@ -371,7 +374,8 @@ namespace IRaCIS.Api.Controllers // 将设置为自定义的会话名称,例如oss-role-session。 assumeRoleRequest.RoleSessionName = $"session-name-{NewId.NextGuid()}"; // 将替换为拥有上传文件到指定OSS Bucket权限的RAM角色的ARN。 - assumeRoleRequest.RoleArn = ossOptions.roleArn; + //assumeRoleRequest.RoleArn = ossOptions.roleArn; + assumeRoleRequest.RoleArn = "acs:ram::1899121822495495:role/webdirect"; assumeRoleRequest.DurationSeconds = 3600; var runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions(); var response = client.AssumeRoleWithOptions(assumeRoleRequest, runtime); diff --git a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/CustomJsonResult .cs b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/CustomJsonResult .cs new file mode 100644 index 000000000..557112b9d --- /dev/null +++ b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/CustomJsonResult .cs @@ -0,0 +1,125 @@ +using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Infrastructure; +using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Globalization; +using System.Threading.Tasks; + +namespace IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson +{ + public class CustomJsonResult : JsonResult + { + public CustomJsonResult(object value) : base(value) { } + + public override void ExecuteResult(ActionContext context) + { + var converter = context.HttpContext.RequestServices.GetService(); + + var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US; + string dateFormat; + + if (!isEn_US) + { + // Chinese date format + dateFormat = "yyyy-MM-dd HH:mm:ss"; + } + else + { + // Default or English date format + dateFormat = "MM/dd/yyyy HH:mm:ss"; + } + + var serializerSettings = new JsonSerializerSettings + { + DateFormatString = dateFormat, + ReferenceLoopHandling = ReferenceLoopHandling.Ignore, + ContractResolver = new NullToEmptyStringResolver(), + DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind, + + }; + serializerSettings.Converters.Add(converter); + var json = JsonConvert.SerializeObject(Value, serializerSettings); + context.HttpContext.Response.ContentType = "application/json"; + context.HttpContext.Response.WriteAsync(json); + } + } + + + public class MyDateTimeConverter : JsonConverter + { + public override DateTime ReadJson(JsonReader reader, Type objectType, DateTime existingValue, bool hasExistingValue, JsonSerializer serializer) + { + return reader.ReadAsDateTime().Value; + } + + public override void WriteJson(JsonWriter writer, DateTime value, JsonSerializer serializer) + { + var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US; + + string dateFormat; + if (!isEn_US) + { + // Chinese date format + dateFormat = "yyyy-MM-dd HH:mm:ss"; + } + else + { + // Default or English date format + dateFormat = "MM/dd/yyyy HH:mm:ss"; + } + + writer.WriteValue(value.ToString(dateFormat)); + + } + } + + public class MyNullableDateTimeConverter : JsonConverter + { + public override DateTime? ReadJson(JsonReader reader, Type objectType, DateTime? existingValue, bool hasExistingValue, JsonSerializer serializer) + { + var val = reader.ReadAsDateTime(); + return val; + } + + public override void WriteJson(JsonWriter writer, DateTime? value, JsonSerializer serializer) + { + var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US; + + string dateFormat; + if (!isEn_US) + { + // Chinese date format + dateFormat = "yyyy-MM-dd HH:mm:ss"; + } + else + { + // Default or English date format + dateFormat = "MM/dd/yyyy HH:mm:ss"; + } + + if (value.HasValue) + { + writer.WriteValue(value.Value.ToString(dateFormat)); + + } + else + { + writer.WriteValue(default(DateTime?)); + } + + } + } + + + + + + + + +} diff --git a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/JSONTimeZoneConverter.cs b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/JSONTimeZoneConverter.cs index 0968daf29..ce758306c 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/JSONTimeZoneConverter.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/JSONTimeZoneConverter.cs @@ -11,19 +11,39 @@ namespace IRaCIS.Core.API /// /// 序列化,反序列化的时候,处理时间 时区转换 /// - public class JSONTimeZoneConverter : DateTimeConverterBase + public class JSONTimeZoneConverter(IHttpContextAccessor _httpContextAccessor) : DateTimeConverterBase { - private readonly IHttpContextAccessor _httpContextAccessor; - private readonly TimeZoneInfo _clientTimeZone; - public JSONTimeZoneConverter(IHttpContextAccessor httpContextAccessor) + private TimeZoneInfo _clientTimeZone; + + private string _dateFormat; + + + + public override bool CanConvert(Type objectType) { - _httpContextAccessor = httpContextAccessor; + #region 设置语言格式化方式,放在构造函数里面做不到动态切换 + + + var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US; + + if (!isEn_US) + { + // Chinese date format + _dateFormat = "yyyy-MM-dd HH:mm:ss"; + } + else + { + // Default or English date format + _dateFormat = "MM/dd/yyyy HH:mm:ss"; + } + + #endregion + + #region 获取当前请求的客户端时区 - //默认是UTC //var timeZoneId = "Etc/UTC"; var timeZoneId = "Asia/Shanghai"; - var timeZoneIdHeader = _httpContextAccessor?.HttpContext?.Request?.Headers["TimeZoneId"]; if (timeZoneIdHeader is not null && !string.IsNullOrEmpty(timeZoneIdHeader.Value)) @@ -33,12 +53,12 @@ namespace IRaCIS.Core.API _clientTimeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId); - } + #endregion + - public override bool CanConvert(Type objectType) - { // 仅支持 DateTime 类型的转换 return objectType == typeof(DateTime)|| objectType == typeof(DateTime?); + } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) @@ -91,7 +111,10 @@ namespace IRaCIS.Core.API { //第一个参数默认使用系统本地时区 也就是应用服务器的时区 DateTime clientZoneTime = TimeZoneInfo.ConvertTime(nullableDateTime.Value, _clientTimeZone); - writer.WriteValue(clientZoneTime); + + //writer.WriteValue(clientZoneTime); + + writer.WriteValue(clientZoneTime.ToString(_dateFormat)); } else { diff --git a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs index 69032ff19..49a8cbdb1 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/NewtonsoftJson/NewtonsoftJsonSetup.cs @@ -1,10 +1,14 @@  using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson; using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Mvc.Infrastructure; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System; +using System.Globalization; namespace IRaCIS.Core.API { @@ -12,37 +16,40 @@ namespace IRaCIS.Core.API { public static void AddNewtonsoftJsonSetup(this IMvcBuilder builder, IServiceCollection services) { + services.AddHttpContextAccessor(); services.AddScoped(); services.AddScoped(); services.AddScoped(); + + builder.AddNewtonsoftJson(options => { - //options.SerializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.Objects; // 忽略循环引用 options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; - //options.SerializerSettings.TypeNameHandling = TypeNameHandling.All; //处理返回给前端 可空类型 给出默认值 比如in? 为null 设置 默认值0 - options.SerializerSettings.ContractResolver = new NullToEmptyStringResolver(); //new DefaultContractResolver();// new NullToEmptyStringResolver(); - // 设置时间格式 - options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; + options.SerializerSettings.ContractResolver = new NullToEmptyStringResolver(); + + // 设置时间格式 isEn_US? "MM/dd/yyyy HH:mm:ss" : + //options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind; + //二者只能取其一 + //options.SerializerSettings.Converters.Add(new MyDateTimeConverter()); + //options.SerializerSettings.Converters.Add(new MyNullableDateTimeConverter()); + + //必须放在后面 options.SerializerSettings.Converters.Add(services.BuildServiceProvider().GetService()); - - //IsoDateTimeConverter - //options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; - }) .AddControllersAsServices()//动态webApi属性注入需要 .ConfigureApiBehaviorOptions(o => - { + { o.SuppressModelStateInvalidFilter = true; //自己写验证 ////这里是自定义验证结果和返回状态码 因为这里是在[ApiController]控制器层校验,动态webApi的不会校验 所以需要单独写一个Filter diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs index be29c21d3..2a2f45b16 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs @@ -46,7 +46,7 @@ namespace IRaCIS.Core.Application.Contracts public bool IsDicom { get; set; } - + } public class UnionStudyMonitorModel : UnionStudyBaseModel @@ -363,4 +363,21 @@ namespace IRaCIS.Core.Application.Contracts public decimal FileFize { get; set; } } + + public class CRCUploadedStudyQuqry + { + [NotDefault] + public Guid SubjectVisitId { get; set; } + + public List DicomStudyIdList { get; set; } + + public List NoneDicomStudyIdList { get; set; } + } + + public class IRReadingDownloadQuery + { + [NotDefault] + public Guid VisitTaskId { get; set; } + + } } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index 58a9b9415..6ddf4bbf1 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -45,7 +45,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc IRepository _readingQuestionCriterionTrialRepository, IDistributedLockProvider _distributedLockProvider) : BaseService, IDownloadAndUploadService { - + /// /// 受试者随机阅片,任务进行随机编号 @@ -490,7 +490,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc { - var extralConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty; + var extralConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty; var config = JsonConvert.DeserializeObject(extralConfig) ?? new TrialExtraConfig(); @@ -608,7 +608,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc } else if (inQuery.SubejctId != null) { - var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubejctId).SelectMany(t=>t.SubjectVisitList) + var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubejctId).SelectMany(t => t.SubjectVisitList) select new @@ -656,7 +656,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc } else { - return ResponseOutput.NotOk("不允许 subjectId subjectId 都不传递"); + return ResponseOutput.NotOk("不允许 subjectId SubejectVisitId 都不传递"); } @@ -894,5 +894,140 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc } + + /// + /// IQC 获取CRC 上传到某一个访视的的检查信息 (原始影像信息 包含dicom 非dicom) + /// + /// + /// + [HttpPost] + public async Task GetCRCUploadedStudyInfo(CRCUploadedStudyQuqry inQuery) + { + var isQueryDicom = inQuery.DicomStudyIdList.Count > 0; + var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0; + + var query = from sv in _subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId) + + + select new + { + SubjectCode = sv.Subject.Code, + VisitName = sv.VisitName, + + StudyList = sv.StudyList.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id):false) + + .Select(u => new + { + u.PatientId, + u.StudyTime, + u.StudyCode, + + SeriesList = u.SeriesList.Select(z => new + { + z.Modality, + + InstanceList = z.DicomInstanceList.Select(k => new + { + k.Path, + k.FileSize + }) + }) + + }).ToList(), + + NoneDicomStudyList = sv.NoneDicomStudyList.Where( t => isQueryNoneDicom?inQuery.NoneDicomStudyIdList.Contains(t.Id):false) + + .Select(nd => new + { + nd.Modality, + nd.StudyCode, + nd.ImageDate, + + FileList = nd.NoneDicomFileList.Select(file => new + { + file.FileName, + file.Path, + file.FileType + }) + }).ToList() + }; + + var result = query.ToList(); + + return ResponseOutput.Ok(result); + } + + + /// + /// IR 阅片页面获取下载检查的信息 会根据标准进行过滤检查,(后端要考虑到一致性分析 subjectCode的问题) + /// + /// + /// + [HttpPost] + public async Task GetIRReadingDownloadStudyInfo(IRReadingDownloadQuery inQuery) + { + var taskInfo = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId) + .Select(t => new + { + t.BlindSubjectCode, + t.IsAnalysisCreate, + t.SourceSubjectVisitId, + t.TrialReadingCriterion.IsImageFilter, + t.TrialReadingCriterion.CriterionModalitys + }) + .FirstNotNullAsync(); + + if (taskInfo.SourceSubjectVisitId == null) + { + return ResponseOutput.NotOk("请开发核实传递的参数,该查询任务关联访视Id没有值"); + } + + var query = from sv in _subjectVisitRepository.Where(t => t.Id == taskInfo.SourceSubjectVisitId) + + + select new + { + SubjectCode = sv.Subject.Code, + VisitName = sv.VisitName, + StudyList = sv.StudyList.AsQueryable().WhereIf(taskInfo.IsImageFilter, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|")) + .Select(u => new + { + u.PatientId, + u.StudyTime, + u.StudyCode, + + SeriesList = u.SeriesList.Select(z => new + { + z.Modality, + + InstancePathList = z.DicomInstanceList.Select(k => new + { + k.Path + }) + }) + + }), + + NoneDicomStudyList = sv.NoneDicomStudyList.AsQueryable().WhereIf(taskInfo.IsImageFilter, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.Modality + "|")) + .Select(nd => new + { + nd.Modality, + nd.StudyCode, + nd.ImageDate, + + FileList = nd.NoneDicomFileList.Select(file => new + { + file.FileName, + file.Path, + file.FileType + }) + }) + }; + + return ResponseOutput.Ok(); + } + } + + } diff --git a/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs b/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs index 199aad976..ecd0a58d1 100644 --- a/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs +++ b/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs @@ -18,6 +18,14 @@ namespace IRaCIS.Core.Domain.Models [ForeignKey("NoneDicomStudyId")] [JsonIgnore] public NoneDicomStudy NoneDicomStudy { get; set; } + + + [JsonIgnore] + public VisitTask VisitTask { get; set; } + + //[ForeignKey("OriginNoneDicomStudyId")] + //[JsonIgnore] + //public NoneDicomStudy OriginNoneDicomStudy { get; set; } #endregion @@ -31,7 +39,16 @@ namespace IRaCIS.Core.Domain.Models public string FileType { get; set; } - public decimal? FileSize { get; set; } + public long? FileSize { get; set; } + + + #region 跟任务绑定 同时区分检查 + + public Guid? VisitTaskId { get; set; } + + public Guid? OriginNoneDicomStudyId { get; set; } + #endregion + } diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index b47d8d4fb..6fbd4ea2e 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -79,7 +79,7 @@ namespace IRaCIS.Core.Domain.Models public List clinicalDataTrialSets { get; set; } = new List { }; [JsonIgnore] - public List ClinicalTrialProjectDetails { get; set; } + public List ClinicalTrialProjectDetails { get; set; } = new List { }; [JsonIgnore] public List TrialDicList { get; set; } = new List(); From 0d446e6fcd2b7de92290b41b14bc6614a4928900 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 27 Aug 2024 15:02:03 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Inspection/FrontAuditConfigService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 592ca05f9..ead87e94b 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -516,6 +516,7 @@ namespace IRaCIS.Core.Application.Service Identification = u.Identification, ForeignKeyValue = p.ForeignKeyValue, ForeignKeyText = p.ForeignKeyText, + p.ForeignKeyEnText, ForeignKeyTable = p.ForeignKeyTableName }).ToListAsync(); list = list.GroupBy(x => new { x.Key }, (key, lst) => new @@ -524,7 +525,8 @@ namespace IRaCIS.Core.Application.Service Identification = string.Empty, ForeignKeyValue = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyValue ?? lst.Max(x => x.ForeignKeyValue), ForeignKeyText = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyText ?? lst.Max(x => x.ForeignKeyText), - ForeignKeyTable = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyTable ?? lst.Max(x => x.ForeignKeyTable), + ForeignKeyEnText = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyTable ?? lst.Max(x => x.ForeignKeyEnText), + ForeignKeyTable = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyTable ?? lst.Max(x => x.ForeignKeyTable), }).ToList(); @@ -538,6 +540,11 @@ namespace IRaCIS.Core.Application.Service string Table = item.ForeignKeyTable; string ForeignKeyValue = item.ForeignKeyValue; string ForeignKeyText = item.ForeignKeyText; + if (_userInfo.IsEn_Us && !item.ForeignKeyEnText.IsNullOrEmpty()) + { + ForeignKeyText = item.ForeignKeyEnText; + + } if (jsonDataValueDic[item.Key] != null) { string value = jsonDataValueDic[item.Key].ToString(); From a9afb684c9177deaefb8a2939952258b521e6ac8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 27 Aug 2024 15:05:46 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E8=BF=94=E5=9B=9E=E4=B8=B4=E6=97=B6toekn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ExtraController.cs | 107 +++++++----------- IRaCIS.Core.Application/Helper/OSSService.cs | 6 + 2 files changed, 47 insertions(+), 66 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index 7cbff77f7..b6cc9483a 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -304,45 +304,43 @@ namespace IRaCIS.Api.Controllers var ossOptions = serviceOption.AliyunOSS; - return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO, AliyunOSS = serviceOption.AliyunOSS, AWS = serviceOption.AWS }); + var client = new Client(new AlibabaCloud.OpenApiClient.Models.Config() + { + //AccessKeyId = ossOptions.accessKeyId, + //AccessKeySecret = ossOptions.accessKeySecret, + AccessKeyId = "LTAI5tJV76pYX5yPg1N9QVE8", + AccessKeySecret = "roRNLa9YG1of4pYruJGCNKBXEWTAWa", - #region 临时token 屏蔽 - //IClientProfile profile = DefaultProfile.GetProfile(ossOptions.RegionId, ossOptions.AccessKeyId, ossOptions.AccessKeySecret); - //DefaultAcsClient client = new DefaultAcsClient(profile); + Endpoint = "sts.cn-hangzhou.aliyuncs.com" + }); + + var assumeRoleRequest = new AlibabaCloud.SDK.Sts20150401.Models.AssumeRoleRequest(); + // 将设置为自定义的会话名称,例如oss-role-session。 + assumeRoleRequest.RoleSessionName = $"session-name-{NewId.NextGuid()}"; + // 将替换为拥有上传文件到指定OSS Bucket权限的RAM角色的ARN。 + //assumeRoleRequest.RoleArn = ossOptions.roleArn; + assumeRoleRequest.RoleArn = "acs:ram::1899121822495495:role/webdirect"; + assumeRoleRequest.DurationSeconds = 7200; + var runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions(); + var response = client.AssumeRoleWithOptions(assumeRoleRequest, runtime); + var credentials = response.Body.Credentials; + + var tempToken = new AliyunOSSTempToken() + { + AccessKeyId = credentials.AccessKeyId, + AccessKeySecret = credentials.AccessKeySecret, + Expiration = credentials.Expiration, + SecurityToken = credentials.SecurityToken, - //// 创建一个STS请求 - //AssumeRoleRequest request = new AssumeRoleRequest - //{ - // RoleArn = ossOptions.RoleArn, // 角色ARN,需要替换为你的角色ARN - // RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义 - // DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时 - //}; + Region = ossOptions.region, + BucketName = ossOptions.bucketName, + ViewEndpoint = ossOptions.viewEndpoint, + }; - //AssumeRoleResponse response = client.GetAcsResponse(request); + return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, AliyunOSS = serviceOption.AliyunOSS, AliyunOSSTemp= tempToken }); - //// 返回STS令牌信息给前端 - //var stsToken = new ObjectStoreDTO() - //{ - // ObjectStoreUse = serviceOption.ObjectStoreUse, - // AliyunOSS = new AliyunOSSTempToken() - // { - // AccessKeyId = response.Credentials.AccessKeyId, - // AccessKeySecret = response.Credentials.AccessKeySecret, - // SecurityToken = response.Credentials.SecurityToken, - // Expiration = response.Credentials.Expiration, - - // Region = ossOptions.Region, - // BucketName = ossOptions.BucketName, - // ViewEndpoint = ossOptions.ViewEndpoint, - - // }, - // MinIO = serviceOption.MinIO - //}; - //return ResponseOutput.Ok(stsToken); - - #endregion } else if (Enum.TryParse(serviceOption.ObjectStoreUse, out var parsedValue) && parsedValue == ObjectStoreUse.MinIO) @@ -356,44 +354,21 @@ namespace IRaCIS.Api.Controllers } [HttpGet("user/getUploadTempToken")] - public IResponseOutput GetUploadTempToken([FromServices] IOptionsMonitor options) + public IResponseOutput GetUploadTempToken([FromServices] IOptionsMonitor options) { - var ossOptions = options.CurrentValue; + var serviceOption = options.CurrentValue; - var client = new Client(new AlibabaCloud.OpenApiClient.Models.Config() + if (Enum.TryParse(serviceOption.ObjectStoreUse, out var parsedEnum) && parsedEnum == ObjectStoreUse.AliyunOSS) { - //AccessKeyId = ossOptions.accessKeyId, - //AccessKeySecret = ossOptions.accessKeySecret, - AccessKeyId = "LTAI5tJV76pYX5yPg1N9QVE8", - AccessKeySecret = "roRNLa9YG1of4pYruJGCNKBXEWTAWa", + var ossOptions = serviceOption.AliyunOSS; + + + + } + + return ResponseOutput.Ok(); - Endpoint = "sts.cn-hangzhou.aliyuncs.com" - }); - var assumeRoleRequest = new AlibabaCloud.SDK.Sts20150401.Models.AssumeRoleRequest(); - // 将设置为自定义的会话名称,例如oss-role-session。 - assumeRoleRequest.RoleSessionName = $"session-name-{NewId.NextGuid()}"; - // 将替换为拥有上传文件到指定OSS Bucket权限的RAM角色的ARN。 - //assumeRoleRequest.RoleArn = ossOptions.roleArn; - assumeRoleRequest.RoleArn = "acs:ram::1899121822495495:role/webdirect"; - assumeRoleRequest.DurationSeconds = 3600; - var runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions(); - var response = client.AssumeRoleWithOptions(assumeRoleRequest, runtime); - var credentials = response.Body.Credentials; - - return ResponseOutput.Ok(new - { - AccessKeyId = credentials.AccessKeyId, - AccessKeySecret = credentials.AccessKeySecret, - Expiration = credentials.Expiration, - SecurityToken = credentials.SecurityToken, - - - Region = ossOptions.region, - BucketName = ossOptions.bucketName, - ViewEndpoint = ossOptions.viewEndpoint, - - }); } diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index a50c92da3..4703f78af 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -14,6 +14,7 @@ using System.Security.AccessControl; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; +using System.Text.Json.Serialization; namespace IRaCIS.Core.Application.Helper { @@ -55,7 +56,10 @@ namespace IRaCIS.Core.Application.Helper public class ObjectStoreServiceOptions { public string ObjectStoreUse { get; set; } + public AliyunOSSOptions AliyunOSS { get; set; } + + public MinIOOptions MinIO { get; set; } public AWSOptions AWS { get; set; } @@ -68,6 +72,8 @@ namespace IRaCIS.Core.Application.Helper public AliyunOSSOptions AliyunOSS { get; set; } + public AliyunOSSTempToken AliyunOSSTemp { get; set; } + public MinIOOptions MinIO { get; set; } public AWSOptions AWS { get; set; } From 049b14ae977f7052e3552851b541612e6cacc107 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 27 Aug 2024 15:18:01 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Inspection/FrontAuditConfigService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index ead87e94b..194d3e036 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -525,7 +525,7 @@ namespace IRaCIS.Core.Application.Service Identification = string.Empty, ForeignKeyValue = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyValue ?? lst.Max(x => x.ForeignKeyValue), ForeignKeyText = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyText ?? lst.Max(x => x.ForeignKeyText), - ForeignKeyEnText = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyTable ?? lst.Max(x => x.ForeignKeyEnText), + ForeignKeyEnText = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyEnText ?? lst.Max(x => x.ForeignKeyEnText), ForeignKeyTable = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyTable ?? lst.Max(x => x.ForeignKeyTable), }).ToList(); From fa2a0e7482400dfabe501dc6468422a35591fd97 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 27 Aug 2024 15:36:19 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Inspection/FrontAuditConfigService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 194d3e036..d587d2ab5 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -836,8 +836,8 @@ namespace IRaCIS.Core.Application.Service parent = b }).SelectMany(a => a.parent, (m, n) => new { - value = n.ValueCN - }).Select(x => x.value).ToListAsync() + value = _userInfo.IsEn_Us ? n.Value : n.ValueCN + }).Select(x => x.value).ToListAsync() ); } } From 7a496e114b8aaa1fc549503854db9613dd176bf7 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 27 Aug 2024 16:09:55 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Inspection/FrontAuditConfigService.cs | 12 ++++++++++++ IRaCIS.Core.Domain.Share/Management/SystemNotice.cs | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index d587d2ab5..0daca93b3 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -858,6 +858,18 @@ namespace IRaCIS.Core.Application.Service value = _userInfo.IsEn_Us ? b.Value : b.ValueCN }).Select(x => x.value).FirstOrDefaultAsync(); } + // + else if (item.Type.ToLower() == FrontAudit.LineSpilt.GetDescription().ToLower()) + { + var data = value.ToString().Split('|').ToList(); + + var codeList= await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => data.Contains(x.Code)), a => a.Id, b => b.ParentId, (a, b) => new + { + value = _userInfo.IsEn_Us ? b.Value : b.ValueCN + }).Select(x => x.value).ToListAsync(); + jsonDataDic[item.Key] = string.Join(",", codeList); + + } //通过字典项的code 翻译 枚举或者 bool else { diff --git a/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs b/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs index 1e8672066..d5a13af7c 100644 --- a/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs +++ b/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs @@ -77,6 +77,13 @@ namespace IRaCIS.Core.Domain.Share.Management /// [DisplayAttribute(Name = "DictionaryType")] DictionaryType = 4, + + + /// + ///LineSpilt + /// + [DisplayAttribute(Name = "LineSpilt")] + LineSpilt = 4, } From e87185a9068b162a36ec26e7ea6b36a656194566 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 27 Aug 2024 16:17:11 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Domain.Share/Management/SystemNotice.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs b/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs index d5a13af7c..2ca23ea9f 100644 --- a/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs +++ b/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs @@ -83,7 +83,7 @@ namespace IRaCIS.Core.Domain.Share.Management ///LineSpilt /// [DisplayAttribute(Name = "LineSpilt")] - LineSpilt = 4, + LineSpilt = 5, } From 3b6da279f8ae5d59a37e54d41b7e8ed68c37f03f Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 27 Aug 2024 16:20:15 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Inspection/FrontAuditConfigService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 0daca93b3..aff06bd50 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -867,7 +867,7 @@ namespace IRaCIS.Core.Application.Service { value = _userInfo.IsEn_Us ? b.Value : b.ValueCN }).Select(x => x.value).ToListAsync(); - jsonDataDic[item.Key] = string.Join(",", codeList); + jsonDataDic[item.Key] = string.Join("|", codeList); } //通过字典项的code 翻译 枚举或者 bool From 2caa7933ee65141d4a63c53e2f2d234d1392b92d Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 27 Aug 2024 16:45:47 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index be961736e..d5f83d4f4 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -146,10 +146,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common .Where(t => t.TrialId == entity.Id && t.IsConfirm).OrderBy(t => t.ShowOrder).Select(t => t.CriterionName).ToList(); //临床数据配置 - var clinicalDataSetNameList = await _dbContext.ClinicalDataTrialSet.Where(t => t.TrialId == entity.Id && t.IsConfirm).Select(t => t.ClinicalDataSetName).ToListAsync(); + var clinicalDataSetNameList = await _dbContext.ClinicalDataTrialSet.Where(t => t.TrialId == entity.Id && t.IsConfirm).Select(t =>_userInfo.IsEn_Us?t.ClinicalDataSetEnName: t.ClinicalDataSetName).ToListAsync(); var memoryClinicalDataSetNameList = entitys.Where(x => x.Entity.GetType() == typeof(ClinicalDataTrialSet)).Select(t => t.Entity as ClinicalDataTrialSet) - .Where(t => t.TrialId == entity.Id && t.IsConfirm).Select(t => t.ClinicalDataSetName).ToList(); + .Where(t => t.TrialId == entity.Id && t.IsConfirm).Select(t => _userInfo.IsEn_Us ? t.ClinicalDataSetEnName : t.ClinicalDataSetName).ToList(); Guid id = entity.Id; From 9f4e43e20a628d0abcd07326b48ac3031c17f1da Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 27 Aug 2024 16:57:56 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E5=BD=B1=E5=83=8F=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=92=8C=E4=B8=8A=E4=BC=A0=E5=85=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImageAndDoc/DTO/DownloadAndUploadDTO.cs | 57 +++++++++++++++- .../ImageAndDoc/DTO/UnionStudyViewDodel.cs | 25 ++++++- .../ImageAndDoc/DownloadAndUploadService.cs | 65 +++++++++++-------- .../Service/ImageAndDoc/_MapConfig.cs | 26 +++++--- IRaCIS.Core.Domain/Image/NoneDicomStudy.cs | 4 ++ .../Image/NoneDicomStudyFile.cs | 10 ++- .../Context/IRaCISDBContext.cs | 2 + 7 files changed, 145 insertions(+), 44 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs index 6f3910b2d..0032537e4 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs @@ -22,7 +22,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO public string TaskName { get; set; } public bool IsImageFilter { get; set; } - public string CriterionModalitys { get; set; } + public string CriterionModalitys { get; set; } public Guid? SourceSubjectVisitId { get; set; } public PackState PackState { get; set; } @@ -33,7 +33,40 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO } - public class StudyBasicInfo + + + + public class StudyBasicInfo : DicomStudyBasicInfo + { + + public List SopInstanceUidList { get; set; } + } + + + public class SubjectCRCImageUploadedDto + { + public Guid VisitTaskId { get; set; } + + public Guid SubjectId { get; set; } + + public string SubjectCode { get; set; } + + public string TaskBlindName { get; set; } + + public string TaskName { get; set; } + + public bool IsImageFilter { get; set; } + public string CriterionModalitys { get; set; } + + public Guid? SourceSubjectVisitId { get; set; } + + public List DicomStudyList { get; set; } + + public List NoneDicomStudyList { get; set; } + } + + + public class DicomStudyBasicInfo { public Guid Id { get; set; } public string StudyInstanceUid { get; set; } @@ -54,8 +87,26 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO public string Description { get; set; } public int SeriesCount { get; set; } public int InstanceCount { get; set; } + } - public List SopInstanceUidList { get; set; } + public class NoneDicomStudyBasicInfo + { + public Guid Id { get; set; } + + public string StudyCode { get; set; } = string.Empty; + + public int FileCount { get; set; } + + public string BodyPart { get; set; } + + public string Modality { get; set; } + + public DateTime ImageDate { get; set; } + + public string Description { get; set; } = string.Empty; + + + } } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs index 2a2f45b16..ef8e2f10a 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs @@ -377,7 +377,30 @@ namespace IRaCIS.Core.Application.Contracts public class IRReadingDownloadQuery { [NotDefault] - public Guid VisitTaskId { get; set; } + public Guid SubjectId { get; set; } + + [NotDefault] + public Guid TrialReadingCriterionId { get; set; } + + public string SubjectCode { get; set; } + } + + + public class IRDownloadQuery + { + [NotDefault] + public Guid SubjectId { get; set; } + + [NotDefault] + public Guid TrialReadingCriterionId { get; set; } + + public string SubjectCode { get; set; } + + public List SubjectVisitIdList { get; set; } + + public List DicomStudyIdList { get; set; } + + public List NoneDicomStudyIdList { get; set; } } } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index 6ddf4bbf1..3c3f7127c 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -914,8 +914,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc SubjectCode = sv.Subject.Code, VisitName = sv.VisitName, - StudyList = sv.StudyList.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id):false) - + StudyList = sv.StudyList.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id) : false) + .Select(u => new { u.PatientId, @@ -935,8 +935,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc }).ToList(), - NoneDicomStudyList = sv.NoneDicomStudyList.Where( t => isQueryNoneDicom?inQuery.NoneDicomStudyIdList.Contains(t.Id):false) - + NoneDicomStudyList = sv.NoneDicomStudyList.Where(t => isQueryNoneDicom ? inQuery.NoneDicomStudyIdList.Contains(t.Id) : false) + .Select(nd => new { nd.Modality, @@ -952,44 +952,53 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc }).ToList() }; - var result = query.ToList(); + var result = query.FirstOrDefault(); return ResponseOutput.Ok(result); } /// - /// IR 阅片页面获取下载检查的信息 会根据标准进行过滤检查,(后端要考虑到一致性分析 subjectCode的问题) + /// IR 阅片页面 和IR 任务列表页面下载 勾选下载列表(后端要考虑到一致性分析 subjectCode的问题) /// /// /// - [HttpPost] - public async Task GetIRReadingDownloadStudyInfo(IRReadingDownloadQuery inQuery) + public async Task> GetSubjectImageDownloadSelectList(IRReadingDownloadQuery inQuery) { - var taskInfo = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId) - .Select(t => new - { - t.BlindSubjectCode, - t.IsAnalysisCreate, - t.SourceSubjectVisitId, - t.TrialReadingCriterion.IsImageFilter, - t.TrialReadingCriterion.CriterionModalitys - }) - .FirstNotNullAsync(); - if (taskInfo.SourceSubjectVisitId == null) - { - return ResponseOutput.NotOk("请开发核实传递的参数,该查询任务关联访视Id没有值"); - } + var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId + && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect) + .ProjectTo(_mapper.ConfigurationProvider); - var query = from sv in _subjectVisitRepository.Where(t => t.Id == taskInfo.SourceSubjectVisitId) + + var list = await query.Where(t=>t.SubjectCode==inQuery.SubjectCode).ToListAsync(); + return list; + + } + + /// + /// IR 阅片页面获取下载检查的信息 会根据标准进行过滤检查,(后端要考虑到一致性分析 subjectCode的问题) + /// + /// + /// + /// + [HttpPost] + public async Task GetIRReadingDownloadStudyInfo(IRDownloadQuery inQuery, [FromServices] IRepository _subjectRepository) + { + var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) + .Select(t => new { t.IsImageFilter, t.CriterionModalitys }).FirstNotNullAsync(); + + var isQueryDicom = inQuery.DicomStudyIdList.Count > 0; + var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0; + + var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubjectId).SelectMany(t => t.SubjectVisitList.Where(t=>inQuery.SubjectVisitIdList.Contains(t.Id))) select new { SubjectCode = sv.Subject.Code, VisitName = sv.VisitName, - StudyList = sv.StudyList.AsQueryable().WhereIf(taskInfo.IsImageFilter, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|")) + StudyList = sv.StudyList.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id) : false) .Select(u => new { u.PatientId, @@ -1008,7 +1017,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc }), - NoneDicomStudyList = sv.NoneDicomStudyList.AsQueryable().WhereIf(taskInfo.IsImageFilter, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.Modality + "|")) + NoneDicomStudyList = sv.NoneDicomStudyList.Where(t => isQueryNoneDicom ? inQuery.NoneDicomStudyIdList.Contains(t.Id) : false) .Select(nd => new { nd.Modality, @@ -1024,7 +1033,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc }) }; - return ResponseOutput.Ok(); + + + var result = await query.FirstOrDefaultAsync(); + + return ResponseOutput.Ok(result); } } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs index 8e41acc53..372bc020c 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs @@ -3,6 +3,7 @@ using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.Dicom.DTO; using IRaCIS.Core.Application.Contracts.DTO; +using IRaCIS.Core.Application.Service.ImageAndDoc.DTO; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Models; @@ -60,17 +61,17 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.StudyTime, t => t.MapFrom(u => u.DicomStudy.StudyTime)) .ForMember(o => o.StudyCode, t => t.MapFrom(u => u.DicomStudy.StudyCode)) - //.ForMember(o => o.InstanceList, t => t.MapFrom(u => u.DicomInstanceList.Select(t=>t.Id).ToArray())) - // .ForMember(o => o.InstancePathList, t => t.MapFrom(u => u.DicomInstanceList.OrderBy(t=>t.InstanceNumber).Select(t => t.Path))) + //.ForMember(o => o.InstanceList, t => t.MapFrom(u => u.DicomInstanceList.Select(t=>t.Id).ToArray())) + // .ForMember(o => o.InstancePathList, t => t.MapFrom(u => u.DicomInstanceList.OrderBy(t=>t.InstanceNumber).Select(t => t.Path))) ; CreateMap() - .ForMember(o => o.IsCompleteClinicalData, t => t.MapFrom(u => !u.ReadingClinicalDataList.Any(x=>x.ReadingClinicalDataPDFList.Count()==0))) - .ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime)) + .ForMember(o => o.IsCompleteClinicalData, t => t.MapFrom(u => !u.ReadingClinicalDataList.Any(x => x.ReadingClinicalDataPDFList.Count() == 0))) + .ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime)) .ForMember(o => o.Uploader, t => t.MapFrom(u => u.Uploader.LastName + " / " + u.Uploader.FirstName)) .ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id)) - .ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t=>t.FailedFileCount>0))) - .ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct()) )); + .ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t => t.FailedFileCount > 0))) + .ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct()))); @@ -124,10 +125,19 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.VisitNum, u => u.MapFrom(s => s.SubjectVisit.VisitNum)) .ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName)); - + CreateMap(); + CreateMap(); + CreateMap() + .ForMember(d => d.VisitTaskId, u => u.MapFrom(s => s.Id)) + .ForMember(d => d.IsImageFilter, u => u.MapFrom(s => s.TrialReadingCriterion.IsImageFilter)) + .ForMember(d => d.CriterionModalitys, u => u.MapFrom(s => s.TrialReadingCriterion.CriterionModalitys)) + .ForMember(d => d.SubjectCode, u => u.MapFrom(u => u.IsSelfAnalysis == true ? u.BlindSubjectCode : u.Subject.Code)) + .ForMember(d => d.DicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.StudyList)) + .ForMember(d => d.NoneDicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.NoneDicomStudyList)) + ; } } - + } diff --git a/IRaCIS.Core.Domain/Image/NoneDicomStudy.cs b/IRaCIS.Core.Domain/Image/NoneDicomStudy.cs index 61b17b548..900b2f720 100644 --- a/IRaCIS.Core.Domain/Image/NoneDicomStudy.cs +++ b/IRaCIS.Core.Domain/Image/NoneDicomStudy.cs @@ -18,6 +18,10 @@ namespace IRaCIS.Core.Domain.Models #region 导航属性 [JsonIgnore] public List NoneDicomFileList { get; set; } + + [JsonIgnore] + public List TaskNoneDicomFileList { get; set; } + [JsonIgnore] public SubjectVisit SubjectVisit { get; set; } [JsonIgnore] diff --git a/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs b/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs index ecd0a58d1..c7c286986 100644 --- a/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs +++ b/IRaCIS.Core.Domain/Image/NoneDicomStudyFile.cs @@ -8,9 +8,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace IRaCIS.Core.Domain.Models { - /// - ///NoneDicomStudyFile - /// + [Table("NoneDicomStudyFile")] public class NoneDicomStudyFile : BaseAddAuditEntity { @@ -23,9 +21,9 @@ namespace IRaCIS.Core.Domain.Models [JsonIgnore] public VisitTask VisitTask { get; set; } - //[ForeignKey("OriginNoneDicomStudyId")] - //[JsonIgnore] - //public NoneDicomStudy OriginNoneDicomStudy { get; set; } + [ForeignKey("OriginNoneDicomStudyId")] + [JsonIgnore] + public NoneDicomStudy OriginNoneDicomStudy { get; set; } #endregion diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 15414fe37..931eb9a6e 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -72,6 +72,8 @@ namespace IRaCIS.Core.Infra.EFCore builder.HasNoKey(); }); + modelBuilder.Entity().HasMany(t => t.NoneDicomFileList).WithOne(s => s.NoneDicomStudy).HasForeignKey(t => t.NoneDicomStudyId); + modelBuilder.Entity().HasMany(t => t.TaskNoneDicomFileList).WithOne(s => s.OriginNoneDicomStudy).HasForeignKey(t => t.OriginNoneDicomStudyId); modelBuilder.Entity().HasQueryFilter(p => p.IsAdditional == false); From 176f50e8360dd870b6a68ca8a95ab729770b42c3 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 27 Aug 2024 17:04:39 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E5=AF=BC=E8=A1=A8=E8=B4=A8=E7=96=91?= =?UTF-8?q?=E6=97=B6=E9=95=BF=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index cea1ddb9d..4e27834da 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -311,7 +311,11 @@ namespace IRaCIS.Core.Application.Contracts get { if (!ClosedTime.HasValue) - return ""; + { + var now = DateTime.Now; + return string.Format("{0}d {1}h {2}m", (now - CreateTime)?.Days, (now - CreateTime)?.Hours, (now - CreateTime)?.Minutes); + + } else return string.Format("{0}d {1}h {2}m", (ClosedTime - CreateTime)?.Days, (ClosedTime - CreateTime)?.Hours, (ClosedTime - CreateTime)?.Minutes); } } @@ -321,7 +325,7 @@ namespace IRaCIS.Core.Application.Contracts public QCChanllengeReuploadEnum ReuploadEnum { get; set; } public List DialogList { get; set; } - public string DialogStr => string.Join("\n\n", DialogList.OrderBy(t => t.CreateTime).Select(c => c.UserName + " (" + ExportExcelConverterDate.DateTimeInternationalToString(c.CreateTime) + ") :" + c.Content)); + public string DialogStr => string.Join("\n\n", DialogList.OrderBy(t => t.CreateTime).Select(c => c.UserName + " (" + ExportExcelConverterDate.DateTimeInternationalToString(c.CreateTime) + ") :" + c.Content)); //public SubmitStateEnum SubmitState { get; set; } //public string? CurrentActionUserName { get; set; }