From 1912e1cfcda9c6fdfe50472c1368c6de68cc5be2 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 31 Aug 2023 16:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E8=87=B4=E6=80=A7=E6=A0=B8=E6=9F=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/UploadDownLoadController.cs | 2 +- IRaCIS.Core.API/IRaCIS.Core.API.xml | 7 +++ .../IRaCIS.Core.Application.xml | 16 ++--- .../Service/QC/DTO/QARecordViewModel.cs | 4 +- .../Service/QC/QCListService.cs | 12 ++-- .../Service/QC/_MapConfig.cs | 2 +- .../Service/TrialSiteUser/TrialService.cs | 2 +- ...sistencyCheckFile.cs => UserUploadFile.cs} | 19 ++++-- .../Common/AuditingData.cs | 59 ++++++++++++++----- .../Context/IRaCISDBContext.cs | 2 +- 10 files changed, 85 insertions(+), 40 deletions(-) rename IRaCIS.Core.Domain/QC/{ConsistencyCheckFile.cs => UserUploadFile.cs} (79%) diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index 1b5d4681f..903eee183 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -772,7 +772,7 @@ namespace IRaCIS.Core.API.Controllers (serverFilePath, relativePath) = FileStoreHelper.GetTrialCheckFilePath(_hostEnvironment, fileName, trialId); - await _repository.AddAsync(new ConsistencyCheckFile() + await _repository.AddAsync(new UserUploadFile() { TrialId = trialId, CreateTime = DateTime.Now, diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.xml b/IRaCIS.Core.API/IRaCIS.Core.API.xml index 7812272dd..fe5eb4c96 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.xml +++ b/IRaCIS.Core.API/IRaCIS.Core.API.xml @@ -212,6 +212,13 @@ Dicom 归档 + + + 上传非Dicom 文件 支持压缩包 多文件上传 + + + + 一致性核查 excel上传 支持三种格式 diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 9d436a2cc..fd02d7287 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -9251,37 +9251,37 @@ 受试者ID - + 文件名称 - + 文件路径 - + 相对路径 - + 创建人 - + 创建时间 - + 项目ID - + 创建者名称 @@ -10412,7 +10412,7 @@ - + 获取一致性核查文件上传记录 diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs index 8b810779b..5bfa134c3 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs @@ -129,7 +129,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO } - public class GetConsistencyCheckFileDto/*: ConsistencyCheckFile*/ + public class GetUserUploadFileDto/*: UserUploadFile*/ { /// /// 文件名称 @@ -170,7 +170,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO } - public class GetConsistencyCheckFileInDto + public class GetUserUploadFileInDto { public Guid TrialId { get; set; } diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index b5a41f3d9..41c6c8df8 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -19,7 +19,7 @@ namespace IRaCIS.Core.Application.Image.QA private readonly IRepository _clinicalDataTrialSet; private readonly IRepository _trialQCQuestionAnswerRepository; private readonly IRepository _trialQCQuestionRepository; - private readonly IRepository _consistencyCheckFileRepository; + private readonly IRepository _UserUploadFileRepository; private IReadingImageTaskService _IReadingImageTaskService; @@ -30,14 +30,14 @@ namespace IRaCIS.Core.Application.Image.QA IRepository trialQCQuestionAnswerRepository, IRepository trialQCQuestionRepository, IReadingImageTaskService IReadingImageTaskService, - IRepository consistencyCheckFileRepository + IRepository UserUploadFileRepository ) { this._IReadingImageTaskService = IReadingImageTaskService; _subjectVisitRepository = subjectVisitRepository; this._trialQCQuestionAnswerRepository = trialQCQuestionAnswerRepository; this._trialQCQuestionRepository = trialQCQuestionRepository; - this._consistencyCheckFileRepository = consistencyCheckFileRepository; + this._UserUploadFileRepository = UserUploadFileRepository; _trialRepository = trialRepository; this._clinicalDataTrialSet = clinicalDataTrialSet; } @@ -849,10 +849,10 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task> GetConsistencyCheckFile(GetConsistencyCheckFileInDto indto) + public async Task> GetUserUploadFile(GetUserUploadFileInDto indto) { - var query = _repository.Where(t => t.TrialId == indto.TrialId) - .ProjectTo(_mapper.ConfigurationProvider); + var query = _repository.Where(t => t.TrialId == indto.TrialId) + .ProjectTo(_mapper.ConfigurationProvider); return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false); } diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 5a2f5022c..f0f5cec09 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -494,7 +494,7 @@ namespace IRaCIS.Core.Application.Service ; // 一致性核查文件 - CreateMap() + CreateMap() .ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName + "/" + t.User.LastName)); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index 0806cb981..6fad583bd 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -286,7 +286,7 @@ namespace IRaCIS.Application.Services await _repository.BatchDeleteAsync(o => o.SubjectVisit.TrialId == trialId); await _repository.BatchDeleteAsync(o => o.TrialId == trialId); - await _repository.BatchDeleteAsync(o => o.TrialId == trialId); + await _repository.BatchDeleteAsync(o => o.TrialId == trialId); await _repository.BatchDeleteAsync(o => o.TrialReadingCriterion.TrialId == trialId); await _repository.BatchDeleteAsync(o => o.TrialId == trialId); await _repository.BatchDeleteAsync(t => t.TrialId == trialId); diff --git a/IRaCIS.Core.Domain/QC/ConsistencyCheckFile.cs b/IRaCIS.Core.Domain/QC/UserUploadFile.cs similarity index 79% rename from IRaCIS.Core.Domain/QC/ConsistencyCheckFile.cs rename to IRaCIS.Core.Domain/QC/UserUploadFile.cs index ac90904b7..78f34a959 100644 --- a/IRaCIS.Core.Domain/QC/ConsistencyCheckFile.cs +++ b/IRaCIS.Core.Domain/QC/UserUploadFile.cs @@ -7,8 +7,8 @@ namespace IRaCIS.Core.Domain.Models /// /// 一致性核查文件 /// - [Table("ConsistencyCheckFile")] - public class ConsistencyCheckFile : Entity, IAuditAdd + [Table("UserUploadFile")] + public class UserUploadFile : Entity, IAuditAdd { /// /// 文件名称 @@ -42,14 +42,23 @@ namespace IRaCIS.Core.Domain.Models /// public Guid TrialId { get; set; } - [JsonIgnore] - /// + [JsonIgnore] + /// /// 创建人 /// [ForeignKey("CreateUserId")] public User User { get; set; } + + public UploadScenarios UploadScenarios { get;set; } + + } + + public enum UploadScenarios + { + Check=0, + + Site=1, } - } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 00df8532b..ae3bc93d8 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -14,6 +14,7 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; +using static Microsoft.EntityFrameworkCore.DbLoggerCategory; namespace IRaCIS.Core.Infra.EFCore.Common @@ -794,7 +795,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common CreateUserName = _userInfo.UserName, UserType = _userInfo.UserTypeShortName, - IsSigned = entity.ConfirmTime!=null, // 是否签署 添加了就是签署了 + IsSigned = entity.ConfirmTime != null, // 是否签署 添加了就是签署了 }); } @@ -935,7 +936,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common ToUserTypes = configUserTypeList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList(), CopyUserTypes = configUserTypeList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(t => t.UserType).ToList(), BlackUserIds = blackUserIdList - }) ; + }); } @@ -994,7 +995,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common #region 附加评估 - + #endregion #region 医学审核 @@ -1011,7 +1012,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var questionIdList = list.Select(t => t.ReadingMedicineQuestionId).ToList(); - var questionNameList = await _dbContext.ReadingMedicineTrialQuestion.Where(x => questionIdList.Contains(x.Id)).Select(t => new { t.QuestionName, ReadingMedicineQuestionId = t.Id, t.ShowOrder }).ToListAsync(); + var questionNameList = await _dbContext.ReadingMedicineTrialQuestion.Where(x => questionIdList.Contains(x.Id)).Select(t => new { t.QuestionName, ReadingMedicineQuestionId = t.Id, t.ShowOrder }).ToListAsync(); var firstEntity = list.FirstOrDefault(); @@ -1160,7 +1161,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var trialQuestionIdList = list.Select(t => t.TrialQCQuestionConfigureId); - var trialQuestionNameList = await _dbContext.TrialQCQuestionConfigure.Where(x => x.TrialId == firstEntity.TrialId).Select(t => new { t.QuestionName, TrialQCQuestionConfigureId = t.Id, t.ShowOrder }).ToListAsync(); + var trialQuestionNameList = await _dbContext.TrialQCQuestionConfigure.Where(x => x.TrialId == firstEntity.TrialId).Select(t => new { t.QuestionName, TrialQCQuestionConfigureId = t.Id, t.ShowOrder }).ToListAsync(); var beforeAnswerList = await _dbContext.TrialQCQuestionAnswer.Where(x => x.SubjectVisitId == firstEntity.SubjectVisitId && x.CurrentQCEnum == firstEntity.CurrentQCEnum && x.QCProcessEnum == firstEntity.QCProcessEnum) .Select(u => new { u.TrialQCQuestionConfigureId, u.Answer }).ToListAsync(); @@ -1356,11 +1357,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common // 一致性核查文件 是否需要单独一个表记录? - foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ConsistencyCheckFile))) + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(UserUploadFile))) { var type = GetEntityAuditOpt(item); - await InsertInspection(item.Entity as ConsistencyCheckFile, type, x => new InspectionConvertDTO() + await InsertInspection(item.Entity as UserUploadFile, type, x => new InspectionConvertDTO() { ObjectRelationParentId = x.TrialId @@ -1840,7 +1841,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common Type = ClinicalFileType.PreviousOther }); } - + #endregion #region 阅片人入组 @@ -1853,6 +1854,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common + //系统临床数据配置 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ClinicalDataSystemSet))) @@ -1881,6 +1883,33 @@ namespace IRaCIS.Core.Infra.EFCore.Common { extraIdentification = "/ConfirmSelect"; } + + if (_userInfo.RequestUrl == "ClinicalDataSet/applyTrialClinical" ) + { + extraIdentification = "/SaveTemplate"; + + var list = await _dbContext.TrialClinicalQuestion.Where(x => x.TrialClinicalId == entity.Id) + .Select(t => new + { + t.QuestionEnName, + t.QuestionName, + GroupNameCN = t.GroupQuestin.QuestionName, + GroupName = t.GroupQuestin.QuestionEnName, + t.ClinicalQuestionType, + t.ClinicalQuestionShowEnum, + t.TypeValue, + t.IsRequired + }).ToListAsync(); + + + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { + IsDistinctionInterface = false, + ExtraIndentification = extraIdentification + }, new { QuestionList = list }); + + continue; + } //获取配置的标准名称 @@ -2070,7 +2099,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common case "VisitTask/ConfirmReReading": - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager ) + if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) { extraIdentification = "/" + 1; } @@ -2109,7 +2138,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //一致性分析规则 - + #endregion @@ -2533,11 +2562,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common var type = GetEntityAuditOpt(item); var entity = item.Entity as PIAudit; - + await InsertInspection(item.Entity as PIAudit, type, x => new InspectionConvertDTO() { ObjectRelationParentId = entity.VisitTaskId, - IsDistinctionInterface=true + IsDistinctionInterface = true }); } @@ -2602,7 +2631,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //同意重阅 case "VisitTask/ConfirmReReading": - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager ) + if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) { type = type + "/" + 1; @@ -2780,7 +2809,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id; inspection.GeneralId = generalId; - inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine) + inspection.ExtraIndentification; + inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine) + inspection.ExtraIndentification; //将实体对象属性 映射到稽查实体 MapEntityPropertyToAuditEntity(entityObj, inspection); @@ -2989,7 +3018,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// 获取稽查记录的标识符 部分业务会进行特殊处理 /// /// - public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false) + public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false) { var entityTypeName = entityObj.GetType().Name; diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 89b628dd9..fd26a923c 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -467,7 +467,7 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet FrontAuditConfig { get; set; } - public virtual DbSet ConsistencyCheckFile { get; set; } + public virtual DbSet UserUploadFile { get; set; } public virtual DbSet CommonDocument { get; set; }