diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index f9fbf7cc..56a14621 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -9,6 +9,8 @@ using IRaCIS.Core.Infrastructure; using Microsoft.Extensions.Options; using static IRaCIS.Core.Domain.Share.StaticData; using Microsoft.AspNetCore.Authorization; +using IRaCIS.Core.Domain.Models; +using MassTransit; namespace IRaCIS.Application.Services { @@ -157,10 +159,8 @@ namespace IRaCIS.Application.Services var currentYearMaxCodeNext = dbMaxCode + 1; - //var test = _trialRepository.Where(t => t.CreateTime.Year == DateTime.Now.Year + 1).Select(t => t.Code).DefaultIfEmpty(1).ToList(); var trial = _mapper.Map(trialAddModel); - //trial.Id = NewId.NextGuid(); var yearStr = DateTime.Now.Year.ToString(); trial.Code = currentYearMaxCodeNext; @@ -179,8 +179,69 @@ namespace IRaCIS.Application.Services //状态变更详细表 trial.ClinicalTrialProjectDetails.Add(new TrialStatusDetail() { TrialId = trial.Id, TrialStatus = (int)TrialEnrollStatus.ChooseDoctor }); + #region 设置默认值 + + //临床信息传输 + trial.ClinicalInformationTransmissionEnum = 0; + //影像质控流程 + trial.QCProcessEnum = TrialQCProcess.NotAudit; + + trial.IsImageConsistencyVerification = false; + + trial.IsTrialProcessConfirmed = true; + trial.IsTrialBasicLogicConfirmed = true; + trial.IsTrialUrgentConfirmed = true; + + + + + + #endregion + + + + trial = await _trialRepository.AddAsync(trial); + + + List needAddCriterionList = + await _repository.Where(x => x.IsEnable && x.CriterionType == CriterionType.RECIST1Pointt1).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + needAddCriterionList.ForEach(x => + { + x.TrialId = trial.Id; + x.ReadingQuestionCriterionSystemId = x.Id; + x.Id = NewId.NextGuid(); + + //手动选择 + x.IsConfirm = true; + x.IsSigned = true; + x.ReadingInfoSignTime = DateTime.Now; + + //阅片平台 + x.ImagePlatform = ImagePlatform.PACS; + x.ReadingTool = ReadingTool.Dicom; + x.ReadingType = ReadingMethod.Single; + + x.IsReadingPeriod = false; + x.IsGlobalReading = false; + x.IsArbitrationReading = false; + x.IsOncologyReading = false; + x.IsReadingTaskViewInOrder = true; + x.ReadingTaskViewEnum = ReadingTaskViewMethod.Subject; + x.IsReadingShowSubjectInfo = true; + x.IsReadingShowPreviousResults = true; + x.DigitPlaces = 1; + x.IseCRFShowInDicomReading = false; + + + + }); + + + await _repository.AddRangeAsync(needAddCriterionList); + //如果是PM, 则需要将该人员添加到 运维人员表 //添加运维人员PM await _repository.AddAsync(new TrialUser() { TrialId = trial.Id, UserId = _userInfo.Id, JoinTime = DateTime.Now }); @@ -191,6 +252,13 @@ namespace IRaCIS.Application.Services //添加访视 await _repository.AddAsync(new VisitStage { TrialId = trial.Id, VisitNum = 0, BlindName = "B" + 0.ToString("D3"), VisitDay = 0, VisitName = "Baseline", IsBaseLine = true }); await _repository.AddAsync(new VisitStage { TrialId = trial.Id, VisitNum = 1, BlindName = "B" + 10.ToString("D3"), VisitDay = 30, VisitName = "Visit 1" }); + await _repository.AddAsync(new VisitStage { TrialId = trial.Id, VisitNum = 2, BlindName = "B" + 20.ToString("D3"), VisitDay = 60, VisitName = "Visit 2" }); + await _repository.AddAsync(new VisitStage { TrialId = trial.Id, VisitNum = 3, BlindName = "B" + 30.ToString("D3"), VisitDay = 90, VisitName = "Visit 2" }); + await _repository.AddAsync(new VisitStage { TrialId = trial.Id, VisitNum = 4, BlindName = "B" + 40.ToString("D3"), VisitDay = 90, VisitName = "Visit 2" }); + + + + var success = await _repository.SaveChangesAsync(); diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index 30a19d51..942e5d00 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -147,19 +147,30 @@ namespace IRaCIS.Core.Domain.Models public bool VisitPlanConfirmed { get; set; } - - /// - /// ߱ž - /// - public string SubjectCodeRule { get; set; } = "5λɣǰ2λΪıţ3λΪ˳ţEDC¼ıűһ"; - /// - /// Ƿ ߱Ź + /// ߱Ź /// public bool IsNoticeSubjectCodeRule { get; set; } = true; /// - /// Ƿ л׼ʱ䣨״θҩʱ䣩 + /// ߱Ÿʽ + /// + public string SubjectCodeRule { get; set; } = "5λɣǰ2λΪıţ3λΪ˳ţEDC¼ıűһ"; + + + /// + /// ߵڶ + /// + public bool IsSubjectSecondCodeView { get; set; } = false; + + + /// + /// ɨУ + /// + public bool IsVerifyVisitImageDate { get; set; } = true; + + /// + ///ӻ׼ Ƿ л׼ʱ䣨״θҩʱ䣩 /// public bool IsHaveFirstGiveMedicineDate { get; set; } = true; @@ -168,36 +179,43 @@ namespace IRaCIS.Core.Domain.Models /// public bool IsHaveSubjectAge { get; set; } = false; + public bool IsSubjectSexView { get; set; } = false; /// - /// Ƿ ȷ - /// - public bool IsEnrollementQualificationConfirm { get; set; } = false; - - - /// - /// ƻ + /// ƻĩη /// public string OutEnrollmentVisitName { get; set; } = "EOT"; - - /// - /// Ƿ ֤Ƭ + /// ӰĿ /// - public bool IsVerifyVisitImageDate { get; set; } = true; + public bool IsImageReplicationAcrossTrial { get; set; } = false; + + public string BodyPartTypes { get; set; } = "ʲ|Բ||ز|/¸|ǻ|ȫ|"; + + public string Modalitys { get; set; } = "CT|MRI|BoneScan|Photograph|PET|X-ray|US"; + + [NotMapped] + public List ModalityList => Modalitys.Split('|', StringSplitOptions.RemoveEmptyEntries).Where(t => !string.IsNullOrEmpty(t)).ToList(); + + + public int ChangeDefalutDays { get; set; } = 5; + + + + + + + //Ƭʽ 1 ҽѧӰ 2 Ƶ 3 ĵ + public int ReadingMode { get; set; } = 1; + /// /// ٴϢ 1ϵͳ¼ 2ϵͳ¼+PDF 0 /// public int ClinicalInformationTransmissionEnum { get; set; } = 1; - /// - /// Ƿ ٴϢ - /// - public bool IsCRAAuditClinicalInformation { get; set; } = false; - /// /// QC 0 1 2˫ /// @@ -208,47 +226,53 @@ namespace IRaCIS.Core.Domain.Models /// public bool IsImageConsistencyVerification { get; set; } = true; + + + + + + + + /// + /// Ƿ ȷ + /// + public bool IsEnrollementQualificationConfirm { get; set; } = false; + + //PD չǷʾ ÷ Ƿʾ PDչ (Ӷ״̬) + public bool IsPDProgressView { get; set; } = false; + + + //ĿӼ + public bool IsUrgent { get; set; } = false; + + + //Suject Editҳ Ƿʾ Ӽ + public bool IsSubjectExpeditedView { get; set; } = false; + + + + + + + + + /// + /// Ƿ ٴϢ + /// + public bool IsCRAAuditClinicalInformation { get; set; } = false; + /// /// Ӱ񵼳 /// public bool IsImageExport { get; set; } = false; - public bool IsSubjectSecondCodeView { get; set; } - - - - //Ƭʽ - public int ReadingMode { get; set; } = 1; - - - - public int ChangeDefalutDays { get; set; } = 5; - - /// - /// Ŀ - /// - public bool IsImageReplicationAcrossTrial { get; set; } = false; - - - public string BodyPartTypes { get; set; } = "ʲ|Բ||ز|/¸|ǻ|ȫ|"; - - - - public string Modalitys { get; set; } = "CT|MRI|BoneScan|Photograph|PET|X-ray|US"; - - [NotMapped] - public List ModalityList => Modalitys.Split('|', StringSplitOptions.RemoveEmptyEntries).Where(t => !string.IsNullOrEmpty(t)).ToList(); - - public string PreliminaryAuditReuploadText { get; set; } = string.Empty; public string ReviewAuditReuploadText { get; set; } = string.Empty; - //PD չǷʾ ÷ Ƿʾ PDչ (Ӷ״̬) - public bool IsPDProgressView { get; set; } //о public string ResearchProgramNo { get; set; } @@ -262,7 +286,6 @@ namespace IRaCIS.Core.Domain.Models // PI public string HeadPI { get; set; } - public bool IsUrgent { get; set; } /// /// Ŀ 1 ʽĿ0 ʽĿ 2ѵĿ @@ -280,10 +303,8 @@ namespace IRaCIS.Core.Domain.Models public DateTime? TrialFinishedTime { get; set; } - public bool IsSubjectSexView { get; set; } = false; - //Suject Editҳ Ƿʾ Ӽ - public bool IsSubjectExpeditedView { get; set; } = false; + public bool IsTrialStart { get; set; } = false;