Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
						commit
						b28ef3b82e
					
				| 
						 | 
				
			
			@ -2213,6 +2213,11 @@
 | 
			
		|||
            文件路径
 | 
			
		||||
            </summary>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingReportDto.LimitEdit">
 | 
			
		||||
            <summary>
 | 
			
		||||
            限制编辑
 | 
			
		||||
            </summary>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingReportDto.IsShowInDicom">
 | 
			
		||||
            <summary>
 | 
			
		||||
            是否显示在Dicom阅片中
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -167,6 +167,10 @@ namespace IRaCIS.Core.Application.ViewModel
 | 
			
		|||
        public ReReadingApplyState ReReadingApplyState { get; set; }
 | 
			
		||||
        public DateTime? SuggesteFinishedTime { get; set; }
 | 
			
		||||
 | 
			
		||||
        //任务来源访视Id  方便回更访视读片状态
 | 
			
		||||
        public Guid? SourceSubjectVisitId { get; set; }
 | 
			
		||||
        public Guid? SouceReadModuleId { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,15 +39,19 @@ namespace IRaCIS.Core.Application.Service.Allocation
 | 
			
		|||
        private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
 | 
			
		||||
        private readonly IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository;
 | 
			
		||||
 | 
			
		||||
        private readonly IRepository<ReadingClinicalData> _readingClinicalDataReposiotry;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        public VisitTaskService(IRepository<SubjectVisit> subjectVisitRepository, IRepository<VisitTask> visitTaskRepository, IRepository<Trial> trialRepository,
 | 
			
		||||
            IRepository<Subject> subjectRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<TaskAllocationRule> taskAllocationRuleRepository,
 | 
			
		||||
            IRepository<ReadModule> readModuleRepository, IRepository<VisitTaskReReading> visitTaskReReadingRepository,
 | 
			
		||||
             IRepository<TaskMedicalReview> taskMedicalReviewRepository,
 | 
			
		||||
            IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
 | 
			
		||||
            , IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository
 | 
			
		||||
            , IRepository<ReadingQuestionCriterionTrial> trialReadingCriterionRepository,
 | 
			
		||||
            IRepository<ReadingClinicalData> readingClinicalDataReposiotry
 | 
			
		||||
            )
 | 
			
		||||
        {
 | 
			
		||||
            _readingClinicalDataReposiotry = readingClinicalDataReposiotry;
 | 
			
		||||
            _taskAllocationRuleRepository = taskAllocationRuleRepository;
 | 
			
		||||
            _visitTaskRepository = visitTaskRepository;
 | 
			
		||||
            _trialRepository = trialRepository;
 | 
			
		||||
| 
						 | 
				
			
			@ -2188,7 +2192,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
 | 
			
		|||
            return ResponseOutput.Ok();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        //包括临床数据签名状态
 | 
			
		||||
        private async Task VisitBackAsync(Guid? subjectVisitId)
 | 
			
		||||
        {
 | 
			
		||||
            var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
 | 
			
		||||
| 
						 | 
				
			
			@ -2224,6 +2228,18 @@ namespace IRaCIS.Core.Application.Service.Allocation
 | 
			
		|||
            sv.ReviewAuditUserId = null;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            if (sv.IsBaseLine)
 | 
			
		||||
            {
 | 
			
		||||
                await _readingClinicalDataReposiotry.UpdatePartialFromQueryAsync(t => t.ReadingId == sv.Id && (t.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject || t.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit),c=>new ReadingClinicalData() { IsSign=false,ReadingClinicalDataState=ReadingClinicalDataStatus.HaveUploaded});
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                await _readingClinicalDataReposiotry.UpdatePartialFromQueryAsync(t => t.ReadingId == sv.Id &&  t.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit, c => new ReadingClinicalData() { IsSign = false, ReadingClinicalDataState =ReadingClinicalDataStatus.HaveUploaded });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            //await _repository.AddAsync(new CheckChallengeDialog() { SubjectVisitId = subjectVisitId, TalkContent = "PM/APM同意一致性核查回退。", UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt });
 | 
			
		||||
 | 
			
		||||
            await _repository.BatchDeleteAsync<TrialQCQuestionAnswer>(t => t.SubjectVisitId == subjectVisitId);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ namespace IRaCIS.Core.Application.Triggers
 | 
			
		|||
                    //退回或者重阅的任务一致性核查通过了  此时设置Subject 重阅影响状态
 | 
			
		||||
                    if (context.Entity.IsPMBackOrReReading == true)
 | 
			
		||||
                    {
 | 
			
		||||
                        await _subjectRepository.UpdatePartialFromQueryAsync(t => t.Id == context.Entity.SubjectId, u => new Subject() { IsReReadingOrBackInfluenceAnalysis = false });
 | 
			
		||||
                        await _subjectRepository.UpdatePartialFromQueryAsync(context.Entity.SubjectId, u => new Subject() { IsReReadingOrBackInfluenceAnalysis = false });
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    context.Entity.IsPMBackOrReReading = false;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2737,350 +2737,5 @@ namespace IRaCIS.Core.Infra.EFCore.Common
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        #region 待废弃  -by zhouhang  调整
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        ///// <summary>
 | 
			
		||||
        ///// 传入实体对象
 | 
			
		||||
        ///// </summary>
 | 
			
		||||
        //public async Task IncomingEntitys(List<EntityEntry> entitys)
 | 
			
		||||
        //{
 | 
			
		||||
        //    // 修改
 | 
			
		||||
        //    await InsertAddEntitys(
 | 
			
		||||
        //        entitys.Where(x => x.State == EntityState.Modified &&
 | 
			
		||||
        //        (!typeof(ISoftDelete).IsAssignableFrom(x.Entity.GetType()) || !(bool)x.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(x.Entity) || NodeleteTableTypes.Contains(x.Entity.GetType()))
 | 
			
		||||
        //    ).ToList(), AuditOpt.Update);
 | 
			
		||||
 | 
			
		||||
        //    // 新增
 | 
			
		||||
        //    await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Added).ToList(), AuditOpt.Add);
 | 
			
		||||
 | 
			
		||||
        //    // 删除
 | 
			
		||||
        //    await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Deleted
 | 
			
		||||
        //    || (typeof(ISoftDelete).IsAssignableFrom(x.Entity.GetType()) && (bool)x.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(x.Entity) && x.State == EntityState.Modified && !NodeleteTableTypes.Contains(x.Entity.GetType()))
 | 
			
		||||
        //    ).ToList(), AuditOpt.Deleted);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        //}
 | 
			
		||||
 | 
			
		||||
        //// 非Dicom文件
 | 
			
		||||
        //if (entitys.Any(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)))
 | 
			
		||||
        //{
 | 
			
		||||
        //    var noneDicomStudyfile = entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)).Select(x => x.Entity).FirstOrDefault() as NoneDicomStudyFile;
 | 
			
		||||
        //    var noneDicomStudy = await _dbContext.NoneDicomStudy.Where(x => x.Id == noneDicomStudyfile.NoneDicomStudyId).FirstOrDefaultAsync();
 | 
			
		||||
        //    if (noneDicomStudy != null)
 | 
			
		||||
        //    {
 | 
			
		||||
        //        var filecount = await _dbContext.NoneDicomStudyFile.Where(x => x.NoneDicomStudyId == noneDicomStudyfile.NoneDicomStudyId).CountAsync();
 | 
			
		||||
        //        var count = entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)).ToList().Count;
 | 
			
		||||
        //        if (type == "Deleted")
 | 
			
		||||
        //        {
 | 
			
		||||
        //            filecount = filecount - count;
 | 
			
		||||
        //        }
 | 
			
		||||
        //        else
 | 
			
		||||
        //        {
 | 
			
		||||
        //            filecount = filecount + count;
 | 
			
		||||
        //        }
 | 
			
		||||
 | 
			
		||||
        //        await InsertInspection<NoneDicomStudy>(noneDicomStudy, type, null, new
 | 
			
		||||
        //        {
 | 
			
		||||
        //            FileCount = filecount,
 | 
			
		||||
        //        });
 | 
			
		||||
 | 
			
		||||
        //    }
 | 
			
		||||
        //}
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 获取稽查通用数据 (每条稽查记录必须查询的)
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="inspection"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        public async Task<InspectionGeneralData> GetInspectionGeneralDataAsync(InspectionConvertDTO inspection)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            InspectionGeneralData generalData = new InspectionGeneralData()
 | 
			
		||||
            {
 | 
			
		||||
                SiteCode = inspection.SiteCode,
 | 
			
		||||
                SiteId = inspection.SiteId,
 | 
			
		||||
                //SiteName = inspection.SiteName,
 | 
			
		||||
                SubjectCode = inspection.SubjectCode,
 | 
			
		||||
                SubjectId = inspection.SubjectId,
 | 
			
		||||
                SubjectVisitId = inspection.SubjectVisitId,
 | 
			
		||||
                SubjectVisitName = inspection.SubjectVisitName,
 | 
			
		||||
                ResearchProgramNo = inspection.ResearchProgramNo,
 | 
			
		||||
                TrialId = inspection.TrialId,
 | 
			
		||||
                TrialName = inspection.TrialName
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            #region 访视  阅片期那里关联了访视  
 | 
			
		||||
 | 
			
		||||
            //if (generalData.SubjectVisitId != null)
 | 
			
		||||
            //{
 | 
			
		||||
            //    //添加访视的时候,会带信息过来
 | 
			
		||||
            //    if (string.IsNullOrEmpty(generalData.SubjectVisitName))
 | 
			
		||||
            //    {
 | 
			
		||||
            //        var info = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x =>
 | 
			
		||||
            //        new { x.VisitName, x.SubjectId, x.SiteId, SubjectCode = x.Subject.Code, TrialSiteCode = x.TrialSite.TrialSiteCode, x.TrialId, x.Trial.ExperimentName, x.Trial.ResearchProgramNo }).FirstOrDefaultAsync()).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
            //        generalData.SubjectVisitName = info.VisitName;
 | 
			
		||||
 | 
			
		||||
            //        generalData.TrialId = info.TrialId;
 | 
			
		||||
            //        generalData.TrialName = info.ExperimentName;
 | 
			
		||||
            //        generalData.ResearchProgramNo = info.ResearchProgramNo;
 | 
			
		||||
            //        generalData.SiteId = info.SiteId;
 | 
			
		||||
            //        generalData.SubjectCode = info.SubjectCode;
 | 
			
		||||
            //        generalData.SubjectId = info.SubjectId;
 | 
			
		||||
            //        generalData.SiteCode = info.TrialSiteCode;
 | 
			
		||||
            //    }
 | 
			
		||||
            //}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            #endregion
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            #region 受试者
 | 
			
		||||
 | 
			
		||||
            if (generalData.SubjectId != null)
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
                // 添加Subject 哪里会带信息过来
 | 
			
		||||
                if (string.IsNullOrEmpty(generalData.SubjectCode))
 | 
			
		||||
                {
 | 
			
		||||
                    var info = (await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => new { SubjectId = x.Id, SubjectCode = x.Code, x.SiteId, TrialSiteCode = x.TrialSite.TrialSiteCode, x.TrialId, x.Trial.ExperimentName, x.Trial.ResearchProgramNo }).FirstOrDefaultAsync()).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    generalData.TrialId = info.TrialId;
 | 
			
		||||
                    generalData.TrialName = info.ExperimentName;
 | 
			
		||||
                    generalData.ResearchProgramNo = info.ResearchProgramNo;
 | 
			
		||||
                    generalData.SiteId = info.SiteId;
 | 
			
		||||
                    generalData.SubjectCode = info.SubjectCode;
 | 
			
		||||
                    generalData.SubjectId = info.SubjectId;
 | 
			
		||||
                    generalData.SiteCode = info.TrialSiteCode;
 | 
			
		||||
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            #endregion
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            #region 中心Code
 | 
			
		||||
 | 
			
		||||
            if (generalData.TrialId != null && generalData.SiteId != null)
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
                generalData.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.TrialId == generalData.TrialId && x.SiteId == generalData.SiteId).Select(t => t.TrialSiteCode).FirstOrDefaultAsync()).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            #endregion
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            #region 项目名称
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            if (generalData.TrialId != null)
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
                //项目添加哪里 直接会带信息过来,不用查询数据库  其他的地方需要查询数据库
 | 
			
		||||
                if (string.IsNullOrEmpty(generalData.ResearchProgramNo) || string.IsNullOrEmpty(generalData.TrialName))
 | 
			
		||||
                {
 | 
			
		||||
                    var trialdata = (await _dbContext.Trial.Select(x => new { x.Id, x.ResearchProgramNo, x.ExperimentName, }).FirstOrDefaultAsync(x => x.Id == generalData.TrialId)).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
                    generalData.ResearchProgramNo = trialdata.ResearchProgramNo;
 | 
			
		||||
 | 
			
		||||
                    generalData.TrialName = trialdata.ExperimentName;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            #endregion
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            return generalData;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        ///// <summary>
 | 
			
		||||
        ///// 映射数据
 | 
			
		||||
        ///// </summary>
 | 
			
		||||
        ///// <param name="data"></param>
 | 
			
		||||
        ///// <param name="mapData">要赋值的对象</param>
 | 
			
		||||
        //public void MapData(dynamic data, dynamic mapData)
 | 
			
		||||
        //{
 | 
			
		||||
        //    List<string> column = new List<string>() { "TrialId", "SiteId", "SubjectId", "SubjectVisitId", "CreateUserName", "TrialName", "SiteName", "SubjectCode", "VisitName", "SubjectVisitName", "RoleName", "SiteCode", "ResearchProgramNo" };
 | 
			
		||||
        //    foreach (var item in column)
 | 
			
		||||
        //    {
 | 
			
		||||
        //        try
 | 
			
		||||
        //        {
 | 
			
		||||
        //            var i = mapData.GetType().GetProperty(item).GetValue(mapData);
 | 
			
		||||
        //            if (i == null || i == default(Guid))
 | 
			
		||||
        //            {
 | 
			
		||||
        //                var value = data.GetType().GetProperty(item).GetValue(data);
 | 
			
		||||
        //                mapData.GetType().GetProperty(item).SetValue(mapData, value);
 | 
			
		||||
        //            }
 | 
			
		||||
 | 
			
		||||
        //        }
 | 
			
		||||
        //        catch (Exception)
 | 
			
		||||
        //        {
 | 
			
		||||
        //            continue;
 | 
			
		||||
 | 
			
		||||
        //        }
 | 
			
		||||
        //    }
 | 
			
		||||
        //}
 | 
			
		||||
 | 
			
		||||
        ///// <summary>
 | 
			
		||||
        ///// 添加稽查
 | 
			
		||||
        ///// </summary>
 | 
			
		||||
        ///// <param name="add">新增的稽查对象</param>
 | 
			
		||||
        ///// <param name="data">数据</param>
 | 
			
		||||
        ///// <returns></returns>
 | 
			
		||||
        ///// <exception cref="BusinessValidationFailedException"></exception>
 | 
			
		||||
        //public async Task AddInspectionRecordAsync<T>(T data, InspectionConvertDTO add, object otherItem = null) where T : class
 | 
			
		||||
        //{
 | 
			
		||||
        //    //MapData(data, add);
 | 
			
		||||
 | 
			
		||||
        //    MapEntityPropertyToAuditEntity(data, add);
 | 
			
		||||
 | 
			
		||||
        //    InspectionGeneralData generalData = new InspectionGeneralData()
 | 
			
		||||
        //    {
 | 
			
		||||
        //        //CreateUserName = add.CreateUserName,
 | 
			
		||||
        //        SiteCode = add.SiteCode,
 | 
			
		||||
        //        SiteId = add.SiteId,
 | 
			
		||||
        //        //SiteName = add.SiteName,
 | 
			
		||||
        //        SubjectCode = add.SubjectCode,
 | 
			
		||||
        //        SubjectId = add.SubjectId,
 | 
			
		||||
        //        SubjectVisitId = add.SubjectVisitId,
 | 
			
		||||
        //        SubjectVisitName = add.SubjectVisitName,
 | 
			
		||||
        //        ResearchProgramNo = add.ResearchProgramNo,
 | 
			
		||||
        //        //RoleName = add.RoleName,
 | 
			
		||||
        //        TrialId = add.TrialId,
 | 
			
		||||
        //        TrialName = add.TrialName
 | 
			
		||||
        //    };
 | 
			
		||||
 | 
			
		||||
        //    await SetInspectionNameValue(generalData);
 | 
			
		||||
 | 
			
		||||
        //    #region 处理标识
 | 
			
		||||
 | 
			
		||||
        //    var from = await _dbContext.FrontAuditConfig.FirstOrDefaultAsync(x => x.Identification == add.Identification);
 | 
			
		||||
        //    add.ObjectTypeId = from?.ObjectTypeId;
 | 
			
		||||
        //    add.OptTypeId = from?.OptTypeId;
 | 
			
		||||
        //    add.ChildrenTypeId = from?.ChildrenTypeId;
 | 
			
		||||
        //    add.ModuleTypeId = from?.ModuleTypeId;
 | 
			
		||||
 | 
			
		||||
        //    #endregion
 | 
			
		||||
        //    if (add.ParentId == null)
 | 
			
		||||
        //    {
 | 
			
		||||
        //        add.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.VisitStageId == add.VisitStageId && x.GeneralId == add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
 | 
			
		||||
        //    }
 | 
			
		||||
        //    add.CreateUserId = _userInfo.Id;
 | 
			
		||||
        //    add.IP = _userInfo.IP;
 | 
			
		||||
        //    add.CreateTime = add.CreateTime == default(DateTime) ? DateTime.Now : add.CreateTime;
 | 
			
		||||
 | 
			
		||||
        //    if (_userInfo.SignId != null)
 | 
			
		||||
        //    {
 | 
			
		||||
        //        add.SignId = _userInfo.SignId;
 | 
			
		||||
        //        add.IsSign = true;
 | 
			
		||||
        //    }
 | 
			
		||||
 | 
			
		||||
        //    var inspectionData = new InspectionJsonDetail()
 | 
			
		||||
        //    {
 | 
			
		||||
        //        //稽查实体,加上扩充的信息
 | 
			
		||||
        //        Data = AddJsonItem(data, otherItem),
 | 
			
		||||
 | 
			
		||||
        //        //通用信息
 | 
			
		||||
        //        CommonData = generalData
 | 
			
		||||
        //    };
 | 
			
		||||
        //    add.JsonDetail = inspectionData.ToJsonStr();
 | 
			
		||||
        //    add.BatchId = _userInfo.BatchId.Value;
 | 
			
		||||
        //    await _dbContext.DataInspection.AddAsync(add);
 | 
			
		||||
        //}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        ///// <summary>
 | 
			
		||||
        ///// 设置项目以及名称
 | 
			
		||||
        ///// </summary>
 | 
			
		||||
        ///// <param name="generalData"></param>
 | 
			
		||||
        ///// <returns></returns>
 | 
			
		||||
        //public async Task SetInspectionNameValue(InspectionGeneralData generalData)
 | 
			
		||||
        //{
 | 
			
		||||
        //    #region 项目名称
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        //    if (generalData.TrialId != null)
 | 
			
		||||
        //    {
 | 
			
		||||
 | 
			
		||||
        //        //项目添加哪里 直接会带信息过来,不用查询数据库  其他的地方需要查询数据库
 | 
			
		||||
        //        if (string.IsNullOrEmpty(generalData.ResearchProgramNo) || string.IsNullOrEmpty(generalData.TrialName))
 | 
			
		||||
        //        {
 | 
			
		||||
        //            var trialdata = (await _dbContext.Trial.Select(x => new { x.Id, x.ResearchProgramNo, x.ExperimentName, }).FirstOrDefaultAsync(x => x.Id == generalData.TrialId)).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
        //            generalData.ResearchProgramNo = trialdata.ResearchProgramNo;
 | 
			
		||||
 | 
			
		||||
        //            generalData.TrialName = trialdata.ExperimentName;
 | 
			
		||||
        //        }
 | 
			
		||||
        //    }
 | 
			
		||||
 | 
			
		||||
        //    #endregion
 | 
			
		||||
 | 
			
		||||
        //    #region 测试中心名称
 | 
			
		||||
 | 
			
		||||
        //    if (generalData.TrialId != null && generalData.SiteId != null)
 | 
			
		||||
        //    {
 | 
			
		||||
 | 
			
		||||
        //        generalData.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.TrialId == generalData.TrialId && x.SiteId == generalData.SiteId).Select(t => t.TrialSiteCode).FirstOrDefaultAsync()).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        //        //// 添加Site 哪里会带信息过来
 | 
			
		||||
        //        //if (string.IsNullOrEmpty(generalData.SiteName))
 | 
			
		||||
        //        //{
 | 
			
		||||
        //        //    generalData.SiteName = (await _dbContext.Site.Where(x => x.Id == generalData.SiteId).Select(x => x.SiteName).FirstOrDefaultAsync()).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
        //        //}
 | 
			
		||||
        //    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        //    #endregion
 | 
			
		||||
 | 
			
		||||
        //    #region 受试者
 | 
			
		||||
 | 
			
		||||
        //    if (generalData.SubjectId != null)
 | 
			
		||||
        //    {
 | 
			
		||||
 | 
			
		||||
        //        // 添加Subject 哪里会带信息过来
 | 
			
		||||
        //        if (string.IsNullOrEmpty(generalData.SubjectCode))
 | 
			
		||||
        //        {
 | 
			
		||||
        //            generalData.SubjectCode = (await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => x.Code).FirstOrDefaultAsync()).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
        //        }
 | 
			
		||||
        //    }
 | 
			
		||||
 | 
			
		||||
        //    #endregion
 | 
			
		||||
 | 
			
		||||
        //    #region 访视
 | 
			
		||||
 | 
			
		||||
        //    if (generalData.SubjectVisitId != null)
 | 
			
		||||
        //    {
 | 
			
		||||
        //        //添加访视的时候,会带信息过来
 | 
			
		||||
        //        if (string.IsNullOrEmpty(generalData.SubjectVisitName))
 | 
			
		||||
        //        {
 | 
			
		||||
        //            generalData.SubjectVisitName = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x => x.VisitName).FirstOrDefaultAsync()).IfNullThrowException();
 | 
			
		||||
        //        }
 | 
			
		||||
        //    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        //    #endregion
 | 
			
		||||
 | 
			
		||||
        //}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        #endregion
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue