Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
02ce0c993d
|
@ -178,18 +178,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetCRCSubjectClinicalOutDto>> GetCRCSubjectClinicalList(GetCRCSubjectClinicalInDto inDto)
|
||||
public async Task<PageOutput<GetCRCSubjectClinicalOutDto>> GetCRCSubjectClinicalList(GetCRCSubjectClinicalInDto inDto)
|
||||
{
|
||||
|
||||
//await AutoAddCRCClinical(new AutoAddClinicalInDto()
|
||||
//{
|
||||
|
||||
// TrialId = inDto.TrialId
|
||||
//}) ;
|
||||
|
||||
|
||||
|
||||
|
||||
var subjects = await _subjectRepository.Where(x => x.TrialId == inDto.TrialId).Select(x => new GetCRCSubjectClinicalResultDto()
|
||||
{
|
||||
SubjectId = x.Id,
|
||||
|
@ -197,7 +193,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
}).ToListAsync();
|
||||
|
||||
|
||||
var clinicalData=await _readingClinicalDataRepository.Where(x=>x.TrialId == inDto.TrialId&&x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC)
|
||||
var clinicalData= _readingClinicalDataRepository.Where(x=>x.TrialId == inDto.TrialId&&x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC&&x.ClinicalDataTrialSet.ClinicalDataLevel!= ClinicalLevel.SubjectVisit)
|
||||
.Where(x=>!x.IsSign)
|
||||
.Include(x=>x.ClinicalDataTrialSet).Select(x=>new GetCRCSubjectClinicalOutDto() {
|
||||
SubjectId=x.SubjectId,
|
||||
|
@ -206,24 +202,20 @@ namespace IRaCIS.Core.Application.Service
|
|||
ClinicalDataTrialSetId = x.ClinicalDataTrialSet.Id,
|
||||
ClinicalDataSetEnName= x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName,
|
||||
}).OrderBy(x=>x.SubjectCode).ToListAsync();
|
||||
});
|
||||
|
||||
// 一次查询报错 分两次写
|
||||
clinicalData.ForEach(x =>
|
||||
var pageList = await clinicalData.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, string.IsNullOrWhiteSpace(inDto.SortField) ? nameof(GetCRCSubjectClinicalOutDto.SubjectCode) : inDto.SortField, inDto.Asc);
|
||||
// 一次查询报错 分两次写
|
||||
pageList.CurrentPageData.ForEach(x =>
|
||||
{
|
||||
x.ClinicalDataSetEnName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us);
|
||||
|
||||
});
|
||||
|
||||
|
||||
var clinicalFormData = await _clinicalFormRepository.Where(x => x.TrialId == inDto.TrialId).ToListAsync();
|
||||
clinicalData.ForEach(n =>
|
||||
pageList.CurrentPageData.ForEach(n =>
|
||||
{
|
||||
n.ClinicalCount = clinicalFormData.Where(y => y.ClinicalDataTrialSetId == n.ClinicalDataTrialSetId && y.SubjectId == n.SubjectId).Count();
|
||||
});
|
||||
|
||||
|
||||
return clinicalData;
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -441,20 +433,27 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
|
||||
public async Task<PageOutput<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
|
||||
{
|
||||
List<GetCRCConfirmListOutDto> result = await _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.WhereIf(inDto.ReadModuleId!=null,x=>x.Id==inDto.ReadModuleId)
|
||||
var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId)
|
||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId)
|
||||
.WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId)
|
||||
.Select(x => new GetCRCConfirmListOutDto()
|
||||
{
|
||||
SubjectId= x.SubjectId,
|
||||
IsCRCConfirm = x.IsCRCConfirm,
|
||||
LatestScanDate = x.SubjectVisit.LatestScanDate,
|
||||
ReadingSetType = x.ReadingSetType,
|
||||
IsPMConfirm = x.IsPMConfirm,
|
||||
SubjectCode=x.Subject.Code,
|
||||
ReadModuleId = x.Id,
|
||||
}).OrderBy(x => x.LatestScanDate).ToListAsync();
|
||||
{
|
||||
|
||||
SubjectId = x.SubjectId,
|
||||
IsCRCConfirm = x.IsCRCConfirm,
|
||||
LatestScanDate = x.SubjectVisit.LatestScanDate,
|
||||
ReadingSetType = x.ReadingSetType,
|
||||
IsPMConfirm = x.IsPMConfirm,
|
||||
SubjectCode = x.Subject.Code,
|
||||
ReadModuleId = x.Id,
|
||||
});
|
||||
|
||||
|
||||
var result = await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, string.IsNullOrWhiteSpace(inDto.SortField) ? nameof(GetCRCConfirmListOutDto.LatestScanDate) : inDto.SortField, inDto.Asc);
|
||||
|
||||
var formList = await _clinicalFormRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.Where(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC)
|
||||
.Where(x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
||||
|
@ -469,7 +468,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
ClinicalDataSetEnName=x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||
}).ToListAsync();
|
||||
var confirmList = await _readModuleCriterionFromRepository.Where(x => x.TrialId == inDto.TrialId).Include(x=>x.ClinicalForm).Include(x=>x.ClinicalForm.ClinicalDataTrialSet).ToListAsync();
|
||||
result.ForEach(x =>
|
||||
result.CurrentPageData.ForEach(x =>
|
||||
{
|
||||
if (x.IsCRCConfirm)
|
||||
{
|
||||
|
@ -524,8 +523,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
ReadModuleId = inDto.ReadModuleId,
|
||||
TrialId = inDto.TrialId,
|
||||
PageIndex=1,
|
||||
PageSize=9999,
|
||||
|
||||
})).SelectMany(x => x.ClinicalFormIdList).ToList();
|
||||
})).CurrentPageData.SelectMany(x => x.ClinicalFormIdList).ToList();
|
||||
|
||||
result.ForEach(x => {
|
||||
|
||||
|
@ -546,10 +547,17 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> CRCConfirmClinical(CRCConfirmClinicalInDto inDto)
|
||||
{
|
||||
var dataList =await this.GetCRCConfirmList(new GetCRCConfirmListInDto()
|
||||
|
||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync();
|
||||
|
||||
var dataList =(await this.GetCRCConfirmList(new GetCRCConfirmListInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId
|
||||
});
|
||||
TrialId = inDto.TrialId,
|
||||
SubjectId= readModule.SubjectId,
|
||||
TrialReadingCriterionId= readModule.TrialReadingCriterionId,
|
||||
PageIndex=1,
|
||||
PageSize=9999,
|
||||
})).CurrentPageData;
|
||||
|
||||
var presentData = dataList.Where(x => x.ReadModuleId == inDto.ReadModuleId).First();
|
||||
var confirmlist= dataList.Where(x =>(x.LatestScanDate < presentData.LatestScanDate && x.ReadingSetType == presentData.ReadingSetType)
|
||||
|
@ -593,10 +601,16 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto)
|
||||
{
|
||||
var dataList = await this.GetCRCConfirmList(new GetCRCConfirmListInDto()
|
||||
|
||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync();
|
||||
var dataList = (await this.GetCRCConfirmList(new GetCRCConfirmListInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId
|
||||
});
|
||||
TrialId = inDto.TrialId,
|
||||
SubjectId = readModule.SubjectId,
|
||||
TrialReadingCriterionId = readModule.TrialReadingCriterionId,
|
||||
PageIndex = 1,
|
||||
PageSize = 9999,
|
||||
})).CurrentPageData;
|
||||
|
||||
var presentData = dataList.Where(x => x.ReadModuleId == inDto.ReadModuleId).First();
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
}
|
||||
|
||||
|
||||
public class GetCRCSubjectClinicalInDto
|
||||
public class GetCRCSubjectClinicalInDto:PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
@ -99,8 +99,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public string Answer { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class GetCRCConfirmListInDto
|
||||
public class GetCRCConfirmListInDto:PageInput
|
||||
{
|
||||
|
||||
public Guid? TrialReadingCriterionId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? ReadModuleId { get; set; }
|
||||
|
@ -138,7 +143,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid ReadModuleId { get; set; }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue