修改一版
parent
141d67088b
commit
0b4ad2e63d
|
@ -276,10 +276,18 @@
|
||||||
<summary>
|
<summary>
|
||||||
下载项目临床数据文件
|
下载项目临床数据文件
|
||||||
</summary>
|
</summary>
|
||||||
<param name="Id"></param>
|
<param name="clinicalDataTrialSetId"></param>
|
||||||
<param name="_clinicalDataTrialSetRepository"></param>
|
<param name="_clinicalDataTrialSetRepository"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.DownloadSystemClinicalFile(System.Guid,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataSystemSet})">
|
||||||
|
<summary>
|
||||||
|
下载系统临床数据文件
|
||||||
|
</summary>
|
||||||
|
<param name="clinicalDataSystemSetId"></param>
|
||||||
|
<param name="_clinicalDataSystemSetRepository"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadTrialDoc(System.Guid)">
|
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadTrialDoc(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
上传项目签名文档
|
上传项目签名文档
|
||||||
|
|
|
@ -2095,13 +2095,23 @@
|
||||||
<param name="trialExternalUserId"></param>
|
<param name="trialExternalUserId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Helper.FileStoreHelper.GetSystemClinicalPathAsync(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataSystemSet},System.Guid)">
|
||||||
|
<summary>
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<param name="_hostEnvironment"></param>
|
||||||
|
<param name="_clinicalDataTrialSetRepository"></param>
|
||||||
|
<param name="id"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Helper.FileStoreHelper.GetTrialClinicalPathAsync(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},System.Guid)">
|
<member name="M:IRaCIS.Core.Application.Helper.FileStoreHelper.GetTrialClinicalPathAsync(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
|
|
||||||
</summary>
|
</summary>
|
||||||
<param name="_hostEnvironment"></param>
|
<param name="_hostEnvironment"></param>
|
||||||
<param name="_commonDocumentRepository"></param>
|
<param name="_clinicalDataTrialSetRepository"></param>
|
||||||
<param name="code"></param>
|
<param name="id"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
</member>
|
</member>
|
||||||
|
|
|
@ -109,10 +109,13 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
private async Task<IResponseOutput> AddTrialClinicalDataTrialSet(Guid trialId)
|
private async Task<IResponseOutput> AddTrialClinicalDataTrialSet(Guid trialId)
|
||||||
{
|
{
|
||||||
var systemIds = await _clinicalDataSystemSetRepository.Select(x => x.Id).ToListAsync();
|
var systemClinicalDataList = await _clinicalDataSystemSetRepository.AsQueryable().ToListAsync();
|
||||||
|
var systemIds = systemClinicalDataList.Select(x => x.Id).ToList();
|
||||||
var trialSystemIds =await _clinicalDataTrialSetRepository.Where(x => x.TrialId == trialId && x.SystemClinicalDataSetId != null).Select(x => x.SystemClinicalDataSetId.Value).ToListAsync();
|
var trialSystemIds =await _clinicalDataTrialSetRepository.Where(x => x.TrialId == trialId && x.SystemClinicalDataSetId != null).Select(x => x.SystemClinicalDataSetId.Value).ToListAsync();
|
||||||
|
//var needUpdateIds = systemIds.Intersect(trialSystemIds).ToList();
|
||||||
|
|
||||||
var needAddids = systemIds.Except(trialSystemIds).ToList();
|
var needAddids = systemIds.Except(trialSystemIds).ToList();
|
||||||
var systemDataList =await _clinicalDataSystemSetRepository.Where(x => needAddids.Contains(x.Id)).ToListAsync();
|
var systemDataList = systemClinicalDataList.Where(x => needAddids.Contains(x.Id)).ToList();
|
||||||
List<ClinicalDataTrialSet> dataSets = systemDataList.Select(x => new ClinicalDataTrialSet()
|
List<ClinicalDataTrialSet> dataSets = systemDataList.Select(x => new ClinicalDataTrialSet()
|
||||||
{
|
{
|
||||||
Id= NewId.NextGuid(),
|
Id= NewId.NextGuid(),
|
||||||
|
@ -126,7 +129,25 @@ namespace IRaCIS.Application.Services
|
||||||
TrialId= trialId,
|
TrialId= trialId,
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
await _clinicalDataTrialSetRepository.AddRangeAsync(dataSets);
|
await _clinicalDataTrialSetRepository.AddRangeAsync(dataSets);
|
||||||
|
|
||||||
|
//var needUpdateitemList = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == trialId && needUpdateIds.Contains(x.SystemClinicalDataSetId.Value)).ToListAsync();
|
||||||
|
//foreach (var item in needUpdateitemList)
|
||||||
|
//{
|
||||||
|
// var systemData = systemClinicalDataList.FirstOrDefault(x => x.Id == item.SystemClinicalDataSetId);
|
||||||
|
// await _clinicalDataTrialSetRepository.UpdatePartialNoQueryAsync(item.Id,x=>new ClinicalDataTrialSet() {
|
||||||
|
|
||||||
|
// ClinicalDataSetName = systemData.ClinicalDataSetName,
|
||||||
|
// ClinicalDataLevel = systemData.ClinicalDataLevel,
|
||||||
|
// ClinicalUploadType = systemData.ClinicalUploadType,
|
||||||
|
// UploadRole = systemData.UploadRole,
|
||||||
|
// FileName = systemData.FileName,
|
||||||
|
// Path = systemData.Path,
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
var result= await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
var result= await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ using MassTransit;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
using Panda.DynamicWebApi.Attributes;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
@ -152,7 +153,8 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
|
||||||
#region MyRegion
|
#region MyRegion
|
||||||
|
dto.SortField = dto.SortField.IsNullOrEmpty() ? "TrialSiteCode" : dto.SortField;
|
||||||
|
dto.SortField = dto.Asc ? dto.SortField : dto.SortField + " desc";
|
||||||
var subjectQuery = _readModuleViewRepository.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
var subjectQuery = _readModuleViewRepository.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
||||||
.WhereIf(dto.SubjectId != null, x => x.SubjectId == dto.SubjectId)
|
.WhereIf(dto.SubjectId != null, x => x.SubjectId == dto.SubjectId)
|
||||||
.WhereIf(dto.TrialSiteCode != null && dto.TrialSiteCode != String.Empty, x => x.TrialSiteCode == dto.TrialSiteCode)
|
.WhereIf(dto.TrialSiteCode != null && dto.TrialSiteCode != String.Empty, x => x.TrialSiteCode == dto.TrialSiteCode)
|
||||||
|
@ -161,8 +163,12 @@ namespace IRaCIS.Application.Services
|
||||||
.WhereIf(dto.ReadingStatus != null, x => x.ReadingStatus == dto.ReadingStatus)
|
.WhereIf(dto.ReadingStatus != null, x => x.ReadingStatus == dto.ReadingStatus)
|
||||||
.WhereIf(dto.Name != null, x => x.Name.Contains(dto.Name)).OrderBy(x => x.SiteCode);
|
.WhereIf(dto.Name != null, x => x.Name.Contains(dto.Name)).OrderBy(x => x.SiteCode);
|
||||||
|
|
||||||
var subjectIds = await subjectQuery.Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
var subjectIds = await subjectQuery.OrderBy(dto.SortField).Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||||
List<ReadModuleView> ReadModuleViewList = await subjectQuery.Where(x => subjectIds.Contains(x.SubjectId)).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<ReadModuleView> ReadModuleViewList = await subjectQuery.Where(x => subjectIds.Contains(x.SubjectId)).OrderBy(dto.SortField).ToListAsync();
|
||||||
List<GetReadModuleDtoOut> getReadList = ReadModuleViewList.GroupBy(x => new { x.SubjectId, x.SiteId, x.TrialSiteCode, x.SubjectCode })
|
List<GetReadModuleDtoOut> getReadList = ReadModuleViewList.GroupBy(x => new { x.SubjectId, x.SiteId, x.TrialSiteCode, x.SubjectCode })
|
||||||
.Select(x => new GetReadModuleDtoOut()
|
.Select(x => new GetReadModuleDtoOut()
|
||||||
{
|
{
|
||||||
|
@ -195,116 +201,6 @@ namespace IRaCIS.Application.Services
|
||||||
}) ;
|
}) ;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 用导航属性写的 有问题
|
|
||||||
//var subjectQuery = _subjectRepository.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
|
|
||||||
// .WhereIf(dto.SubjectId != null, x => x.Id == dto.SubjectId).Include(x => x.SubjectVisitList).Include(x => x.Site).Include(x => x.TrialSite)
|
|
||||||
// .WhereIf(dto.TrialSiteCode != null, x => x.TrialSite.TrialSiteCode == dto.TrialSiteCode)
|
|
||||||
// .WhereIf(dto.SubjectCode != null, x => x.Code == dto.SubjectCode)
|
|
||||||
|
|
||||||
// .Select(x => new GetReadModuleDtoOut
|
|
||||||
// {
|
|
||||||
// TrialSiteCode = x.TrialSite.TrialSiteCode,
|
|
||||||
// SiteCode = x.TrialSite.TrialSiteCode,
|
|
||||||
// SiteId = x.SiteId,
|
|
||||||
// SubjectCode = x.Code,
|
|
||||||
// SubjectId = x.Id,
|
|
||||||
// Data = x.SubjectVisitList.OrderByDescending(y => y.VisitNum).Select(y => new GetReadModuleOutDto()
|
|
||||||
// {
|
|
||||||
// Id = y.Id, //id
|
|
||||||
// Name = y.VisitName,
|
|
||||||
// ModuleType = y.InPlan ? ModuleTypeEnum.InPlanSubjectVisit : ModuleTypeEnum.OutPlanSubjectVisit, // 模块类型
|
|
||||||
// IsUrgent = x.IsUrgent, // 是否加急
|
|
||||||
// SubjectVisitId = y.Id, // 访视ID
|
|
||||||
// SubjectVisitName = y.VisitName, // 访视名称
|
|
||||||
// Status = ReadingCommon.GetVisitSubmitStateEnum(y), // 状态
|
|
||||||
// CreateTime = y.CreateTime, // 创建时间
|
|
||||||
// SubjectCode = y.Subject.Code, // 受试者code
|
|
||||||
// TrialSiteCode = x.TrialSite.TrialSiteCode, // 中心Code
|
|
||||||
// VisitNum = y.VisitNum,
|
|
||||||
|
|
||||||
// IsFinalVisit = y.IsFinalVisit, // 是否为末次评估
|
|
||||||
// OutPlanPreviousVisitId = y.OutPlanPreviousVisitId, // 上一访视
|
|
||||||
// OutPlanPreviousVisitName = y.OutPlanPreviousVisit.VisitName, // 上一访视名称
|
|
||||||
// SiteId = x.Site.Id, // 中心ID
|
|
||||||
// IsVisit = true, // 是否为访视
|
|
||||||
// PDState = y.PDState, // PD 进展
|
|
||||||
// IsEnrollmentConfirm = y.IsEnrollmentConfirm, // 入组
|
|
||||||
// SubjectId = x.Id,
|
|
||||||
// }).ToList(),
|
|
||||||
|
|
||||||
// ReadModuleData = x.ReadModuleList.Select(
|
|
||||||
// z => new GetReadModuleOutDto()
|
|
||||||
// {
|
|
||||||
// CreateTime = z.CreateTime,
|
|
||||||
// Id = z.Id,
|
|
||||||
// Name = z.ModuleName,
|
|
||||||
// SubjectId = x.Id,
|
|
||||||
// ModuleType = z.ModuleType,
|
|
||||||
// Status = ReadingCommon.GetVisitSubmitStateEnum(z.SubjectVisit),
|
|
||||||
// SubjectCode = x.Code,
|
|
||||||
// TrialSiteCode = x.TrialSite.TrialSiteCode,
|
|
||||||
// SubjectVisitId = z.SubjectVisitId,
|
|
||||||
// SubjectVisitName = z.SubjectVisit.VisitName, // 截止访视名称
|
|
||||||
// CutOffVisitId = z.SubjectVisitId, // 截止访视
|
|
||||||
// CutOffVisitName = z.SubjectVisit.VisitName, // 截止访视名称
|
|
||||||
// ReadModuleId = z.ReadModuleId,
|
|
||||||
// ReadModuleName = z.ReadModuleModel.ModuleName,
|
|
||||||
// IsUrgent = z.IsUrgent
|
|
||||||
// }).ToList(),
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if (dto.ModuleType != null)
|
|
||||||
//{
|
|
||||||
// subjectQuery.
|
|
||||||
//}
|
|
||||||
//if (dto.Status != null)
|
|
||||||
//{
|
|
||||||
// x.Data = x.Data.Where(y => y.Status == dto.Status).ToList();
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (dto.Name != null)
|
|
||||||
//{
|
|
||||||
// x.Data = x.Data.Where(y => y.Name.Contains(y.Name)).ToList();
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//var pageList = await subjectQuery.ToPagedListAsync(dto.PageIndex, dto.PageSize, dto.SortField == null || dto.SortField == string.Empty ? "SiteCode" : dto.SortField,
|
|
||||||
// dto.Asc);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//pageList.CurrentPageData.ForEach(x =>
|
|
||||||
//{
|
|
||||||
// var outplan = x.Data.FirstOrDefault(x => x.IsFinalVisit);
|
|
||||||
// if (outplan != null)
|
|
||||||
// {
|
|
||||||
// x.Data = x.Data.Where(y => y.VisitNum >= outplan.VisitNum).ToList();
|
|
||||||
// }
|
|
||||||
//});
|
|
||||||
|
|
||||||
//var subjectIds = pageList.CurrentPageData.Select(x => x.SubjectId).ToList();
|
|
||||||
|
|
||||||
//var readModules = await _readModuleRepository.Where(x => subjectIds.Contains(x.SubjectId)).Include(x => x.SubjectVisit)
|
|
||||||
// .Include(x => x.ReadModuleModel).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
//return (pageList, new
|
|
||||||
//{
|
|
||||||
// MaxLength = pageList.CurrentPageData.ToList().Max(x => x.Data.Count)
|
|
||||||
//});
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -161,6 +161,12 @@ namespace IRaCIS.Application.Services
|
||||||
if (inDto.IsCompleteConfig)
|
if (inDto.IsCompleteConfig)
|
||||||
{
|
{
|
||||||
await UpdateTrialCriterion(inDto.Id);
|
await UpdateTrialCriterion(inDto.Id);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x=>x.ReadingQuestionCriterionSystemId== inDto.Id, x => new ReadingQuestionCriterionTrial()
|
||||||
|
{
|
||||||
|
IsCompleteConfig = inDto.IsCompleteConfig
|
||||||
|
});
|
||||||
}
|
}
|
||||||
var result = await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
|
var result = await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
@ -373,11 +379,12 @@ namespace IRaCIS.Application.Services
|
||||||
ParentTriggerValue = quesiton.ParentTriggerValue,
|
ParentTriggerValue = quesiton.ParentTriggerValue,
|
||||||
QuestionName = quesiton.QuestionName,
|
QuestionName = quesiton.QuestionName,
|
||||||
ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
|
ReadingQuestionCriterionTrialId = ReadingQuestionCriterionTrialId,
|
||||||
|
ReadingQuestionSystemId= quesiton.Id,
|
||||||
|
SystemParentId=quesiton.ParentId,
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
AnswerGroup = string.Empty,
|
AnswerGroup = string.Empty,
|
||||||
Type = quesiton.Type,
|
Type = quesiton.Type,
|
||||||
GroupName=quesiton.GroupName,
|
GroupName=quesiton.GroupName,
|
||||||
ReadingQuestionSystemId=x.Id,
|
|
||||||
IsJudgeQuestion =quesiton.IsJudgeQuestion,
|
IsJudgeQuestion =quesiton.IsJudgeQuestion,
|
||||||
Remark=quesiton.Remark,
|
Remark=quesiton.Remark,
|
||||||
TypeValue = quesiton.TypeValue,
|
TypeValue = quesiton.TypeValue,
|
||||||
|
@ -411,6 +418,7 @@ namespace IRaCIS.Application.Services
|
||||||
IsEnable = quesiton.IsEnable,
|
IsEnable = quesiton.IsEnable,
|
||||||
IsRequired = quesiton.IsRequired,
|
IsRequired = quesiton.IsRequired,
|
||||||
ParentId = newParentId,
|
ParentId = newParentId,
|
||||||
|
SystemParentId = quesiton.ParentId,
|
||||||
ReadingQuestionSystemId = x.Id,
|
ReadingQuestionSystemId = x.Id,
|
||||||
AnswerGroup = string.Empty,
|
AnswerGroup = string.Empty,
|
||||||
ParentTriggerValue = quesiton.ParentTriggerValue,
|
ParentTriggerValue = quesiton.ParentTriggerValue,
|
||||||
|
|
|
@ -87,6 +87,11 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? ReadingQuestionSystemId { get; set; }
|
public Guid? ReadingQuestionSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 系统标准的ParentId
|
||||||
|
/// </summary>
|
||||||
|
public Guid? SystemParentId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 答案分组
|
/// 答案分组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue