IRC_NewDev
parent
f2dee26cdb
commit
58e11f12e1
|
@ -440,6 +440,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<List<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
|
||||
{
|
||||
List<GetCRCConfirmListOutDto> result = await _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.WhereIf(inDto.ReadModuleId!=null,x=>x.Id==inDto.ReadModuleId)
|
||||
.Select(x => new GetCRCConfirmListOutDto()
|
||||
{
|
||||
SubjectId= x.SubjectId,
|
||||
|
@ -447,46 +448,93 @@ namespace IRaCIS.Core.Application.Service
|
|||
LatestScanDate = x.SubjectVisit.LatestScanDate,
|
||||
ReadingSetType = x.ReadingSetType,
|
||||
IsPMConfirm = x.IsPMConfirm,
|
||||
SubjectCode=x.Subject.Code,
|
||||
ReadModuleId = x.Id,
|
||||
}).OrderBy(x => x.LatestScanDate).ToListAsync();
|
||||
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)
|
||||
.Select(x => new CRCClinicalForm
|
||||
.Include(x=>x.ClinicalDataTrialSet)
|
||||
.Select(x => new CRCClinicalForm
|
||||
{
|
||||
CkeckDate = x.CheckDate,
|
||||
CheckDate = x.CheckDate,
|
||||
ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel,
|
||||
ClinicalFormId = x.Id,
|
||||
ClinicalDataSetName=x.ClinicalDataTrialSet.ClinicalDataSetName,
|
||||
ClinicalDataSetEnName=x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||
}).ToListAsync();
|
||||
var confirmList = await _readModuleCriterionFromRepository.Where(x => x.TrialId == inDto.TrialId).ToListAsync();
|
||||
var confirmList = await _readModuleCriterionFromRepository.Where(x => x.TrialId == inDto.TrialId).Include(x=>x.ClinicalForm).Include(x=>x.ClinicalForm.ClinicalDataTrialSet).ToListAsync();
|
||||
result.ForEach(x =>
|
||||
{
|
||||
if (x.IsCRCConfirm)
|
||||
{
|
||||
x.ClinicalFormIdList = confirmList.Where(y => y.ReadModuleId == x.ReadModuleId).Select(y=>y.ClinicalFormId).ToList();
|
||||
x.ClinicalFormIdList = confirmList.Where(y => y.ReadModuleId == x.ReadModuleId).Select(y=>new GetCRCBeConfirmListOutDto() {
|
||||
CheckDate = y.ClinicalForm.CheckDate??default(DateTime),
|
||||
ClinicalDataSetName= y.ClinicalForm.ClinicalDataTrialSet.ClinicalDataSetName,
|
||||
ClinicalDataSetEnName= y.ClinicalForm.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||
ClinicalFormId=y.ClinicalFormId,
|
||||
}).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x.ReadingSetType == ReadingSetType.ImageReading)
|
||||
{
|
||||
x.ClinicalFormIdList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.ImageRead&&y.CkeckDate<=x.LatestScanDate).Select(y => y.ClinicalFormId).ToList();
|
||||
x.ClinicalFormIdList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.ImageRead&&y.CheckDate <= x.LatestScanDate)
|
||||
.Select(y => new GetCRCBeConfirmListOutDto()
|
||||
{
|
||||
CheckDate = y.CheckDate ?? default(DateTime),
|
||||
ClinicalDataSetName = y.ClinicalDataSetName,
|
||||
ClinicalDataSetEnName = y.ClinicalDataSetEnName,
|
||||
ClinicalFormId = y.ClinicalFormId,
|
||||
}).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
x.ClinicalFormIdList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.OncologyRead&&y.CkeckDate <= x.LatestScanDate).Select(y => y.ClinicalFormId).ToList();
|
||||
x.ClinicalFormIdList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.OncologyRead&&y.CheckDate <= x.LatestScanDate)
|
||||
.Select(y => new GetCRCBeConfirmListOutDto()
|
||||
{
|
||||
CheckDate = y.CheckDate ?? default(DateTime),
|
||||
ClinicalDataSetName = y.ClinicalDataSetName,
|
||||
ClinicalDataSetEnName = y.ClinicalDataSetEnName,
|
||||
ClinicalFormId = y.ClinicalFormId,
|
||||
}).ToList();
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC 确认临床数据
|
||||
/// 获取CRC待确认列表
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetCRCBeConfirmListOutDto>> GetCRCBeConfirmList(GetCRCBeConfirmListInDto inDto)
|
||||
{
|
||||
var result = (await this.GetCRCConfirmList(new GetCRCConfirmListInDto()
|
||||
{
|
||||
ReadModuleId = inDto.ReadModuleId,
|
||||
TrialId = inDto.TrialId
|
||||
})).SelectMany(x => x.ClinicalFormIdList).ToList();
|
||||
|
||||
result.ForEach(x => {
|
||||
|
||||
x.ClinicalDataSetName = _userInfo.IsEn_Us ? x.ClinicalDataSetEnName : x.ClinicalDataSetName;
|
||||
|
||||
});
|
||||
|
||||
return result.OrderBy(x => x.ClinicalDataSetName).ThenBy(x => x.CheckDate).ToList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC 确认临床数据
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> CRCConfirmClinical(CRCConfirmClinicalInDto inDto)
|
||||
{
|
||||
var dataList =await this.GetCRCConfirmList(new GetCRCConfirmListInDto()
|
||||
|
|
|
@ -102,6 +102,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public class GetCRCConfirmListInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? ReadModuleId { get; set; }
|
||||
}
|
||||
|
||||
public class CRCCancelConfirmClinicalInDto
|
||||
|
@ -111,6 +113,25 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public Guid ReadModuleId { get; set; }
|
||||
}
|
||||
|
||||
public class GetCRCBeConfirmListInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid ReadModuleId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class GetCRCBeConfirmListOutDto
|
||||
{
|
||||
public Guid ClinicalFormId { get; set; }
|
||||
|
||||
public string ClinicalDataSetName { get; set; }
|
||||
|
||||
public string ClinicalDataSetEnName { get; set; }
|
||||
|
||||
public DateTime CheckDate { get; set; }
|
||||
}
|
||||
|
||||
public class CRCConfirmClinicalInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
@ -121,7 +142,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public class CRCClinicalForm
|
||||
{
|
||||
public DateTime? CkeckDate { get; set; }
|
||||
public DateTime? CheckDate { get; set; }
|
||||
|
||||
public Guid ClinicalFormId { get; set; }
|
||||
|
||||
|
@ -129,6 +150,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
/// 临床级别
|
||||
/// </summary>
|
||||
public ClinicalLevel ClinicalDataLevel { get; set; }
|
||||
|
||||
public string ClinicalDataSetName { get; set; }
|
||||
|
||||
public string ClinicalDataSetEnName { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
@ -147,13 +172,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public bool IsCRCConfirm { get; set; } = false;
|
||||
|
||||
public string SubjectCode { get; set; }
|
||||
/// <summary>
|
||||
/// 最晚拍片日期
|
||||
/// </summary>
|
||||
public DateTime? LatestScanDate { get; set; }
|
||||
|
||||
|
||||
public List<Guid> ClinicalFormIdList { get; set; }
|
||||
public List<GetCRCBeConfirmListOutDto> ClinicalFormIdList { get; set; }
|
||||
|
||||
public int FormCount
|
||||
{
|
||||
|
|
|
@ -45,8 +45,13 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ClinicalFormId")]
|
||||
public ClinicalForm ClinicalForm { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue