Uat_Study
parent
88b800415c
commit
808dfe7d31
|
@ -408,56 +408,94 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<List<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
|
||||
{
|
||||
|
||||
List<GetCRCConfirmListOutDto> result = await _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.Select(x => new GetCRCConfirmListOutDto()
|
||||
{
|
||||
IsCRCConfirm = x.IsCRCConfirm,
|
||||
LatestScanDate = x.SubjectVisit.LatestScanDate,
|
||||
ReadingSetType = x.ReadingSetType,
|
||||
IsPMConfirm = x.IsPMConfirm,
|
||||
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 CRCConfirmFormList
|
||||
{
|
||||
CkeckDate=x.CheckDate,
|
||||
ClinicalDataLevel= x.ClinicalDataTrialSet.ClinicalDataLevel,
|
||||
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
var confirmList = await _readModuleCriterionFromRepository.Where(x => x.TrialId == inDto.TrialId).ToListAsync();
|
||||
|
||||
List<GetCRCConfirmListOutDto> result = await _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.Select(x => new GetCRCConfirmListOutDto()
|
||||
{
|
||||
SubjectId= x.SubjectId,
|
||||
IsCRCConfirm = x.IsCRCConfirm,
|
||||
LatestScanDate = x.SubjectVisit.LatestScanDate,
|
||||
ReadingSetType = x.ReadingSetType,
|
||||
IsPMConfirm = x.IsPMConfirm,
|
||||
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
|
||||
{
|
||||
CkeckDate = x.CheckDate,
|
||||
ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel,
|
||||
ClinicalFormId = x.Id,
|
||||
}).ToListAsync();
|
||||
var confirmList = await _readModuleCriterionFromRepository.Where(x => x.TrialId == inDto.TrialId).ToListAsync();
|
||||
result.ForEach(x =>
|
||||
{
|
||||
if (x.IsCRCConfirm)
|
||||
{
|
||||
x.FormCount = confirmList.Where(y => y.ReadModuleId == x.ReadModuleId).Count();
|
||||
|
||||
x.ClinicalFormIdList = confirmList.Where(y => y.ReadModuleId == x.ReadModuleId).Select(y=>y.ClinicalFormId).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x.ReadingSetType == ReadingSetType.ImageReading)
|
||||
{
|
||||
x.FormCount = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.ImageRead&&y.CkeckDate<=x.LatestScanDate).Count();
|
||||
|
||||
x.ClinicalFormIdList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.ImageRead&&y.CkeckDate<=x.LatestScanDate).Select(y => y.ClinicalFormId).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
x.FormCount = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.OncologyRead&&y.CkeckDate <= x.LatestScanDate).Count();
|
||||
x.ClinicalFormIdList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.OncologyRead&&y.CkeckDate <= x.LatestScanDate).Select(y => y.ClinicalFormId).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC 确认临床数据
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> CRCConfirmClinical(CRCConfirmClinicalInDto inDto)
|
||||
{
|
||||
var dataList =await this.GetCRCConfirmList(new GetCRCConfirmListInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId
|
||||
});
|
||||
|
||||
var presentData = dataList.Where(x => x.ReadModuleId == inDto.ReadModuleId).First();
|
||||
var confirmlist= dataList.Where(x =>(x.LatestScanDate < presentData.LatestScanDate && x.ReadingSetType == presentData.ReadingSetType)
|
||||
|| x.ReadModuleId == presentData.ReadModuleId).Where(x => !x.IsCRCConfirm).ToList();
|
||||
|
||||
List<ReadModuleCriterionFrom> needAddList = new List<ReadModuleCriterionFrom>()
|
||||
{
|
||||
|
||||
};
|
||||
confirmlist.ForEach(x =>
|
||||
{
|
||||
x.ClinicalFormIdList.ForEach(y =>
|
||||
{
|
||||
needAddList.Add(new ReadModuleCriterionFrom()
|
||||
{
|
||||
ClinicalFormId = y,
|
||||
ReadModuleId = x.ReadModuleId,
|
||||
SubjectId = x.SubjectId,
|
||||
TrialId = inDto.TrialId,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
var readModuleIds = confirmlist.Select(x => x.ReadModuleId).ToList();
|
||||
|
||||
await _readModuleRepository.UpdatePartialFromQueryAsync(x => readModuleIds.Contains(x.Id),x=>new ReadModule() {
|
||||
IsCRCConfirm=true
|
||||
});
|
||||
await _readModuleCriterionFromRepository.AddRangeAsync(needAddList);
|
||||
|
||||
await _readModuleCriterionFromRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,10 +99,20 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
public class CRCConfirmFormList
|
||||
public class CRCConfirmClinicalInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid ReadModuleId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class CRCClinicalForm
|
||||
{
|
||||
public DateTime? CkeckDate { get; set; }
|
||||
|
||||
public Guid ClinicalFormId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 临床级别
|
||||
/// </summary>
|
||||
|
@ -125,7 +135,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
/// </summary>
|
||||
public DateTime? LatestScanDate { get; set; }
|
||||
|
||||
public int FormCount { get; set; }
|
||||
|
||||
public List<Guid> ClinicalFormIdList { get; set; }
|
||||
|
||||
public int FormCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ClinicalFormIdList.Count();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SubmitClinicalFormInDto
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -178,7 +180,37 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
/// 单位
|
||||
/// </summary>
|
||||
public string Unit { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算标记
|
||||
/// </summary>
|
||||
public ClinicalCalculateMark? CustomCalculateMark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算问题
|
||||
/// </summary>
|
||||
public string CalculateQuestions { get; set; } = "[]";
|
||||
|
||||
[NotMapped]
|
||||
public List<CalculateInfo> CalculateQuestionList
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var result = JsonConvert.DeserializeObject<List<CalculateInfo>>(this.CalculateQuestions);
|
||||
return result == null ? new List<CalculateInfo>() : result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return new List<CalculateInfo>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询临床数据基类
|
||||
|
@ -218,16 +250,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
/// 项目临床数据Id
|
||||
/// </summary>
|
||||
public Guid TrialClinicalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算标记
|
||||
/// </summary>
|
||||
public ClinicalCalculateMark? ClinicalCalculateMarkEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算问题
|
||||
/// </summary>
|
||||
public string CalculateQuestions { get; set; } = "[]";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -126,7 +126,37 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// 单位
|
||||
/// </summary>
|
||||
public string Unit { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算标记
|
||||
/// </summary>
|
||||
public ClinicalCalculateMark? CustomCalculateMark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算问题
|
||||
/// </summary>
|
||||
public string CalculateQuestions { get; set; } = "[]";
|
||||
|
||||
[NotMapped]
|
||||
public List<CalculateInfo> CalculateQuestionList
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var result = JsonConvert.DeserializeObject<List<CalculateInfo>>(this.CalculateQuestions);
|
||||
return result == null ? new List<CalculateInfo>() : result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return new List<CalculateInfo>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ using IRaCIS.Core.Domain.Share;
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
|
@ -125,17 +126,37 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// <summary>
|
||||
/// 自定义计算标记
|
||||
/// </summary>
|
||||
public ClinicalCalculateMark? ClinicalCalculateMarkEnum { get; set; }
|
||||
public ClinicalCalculateMark? CustomCalculateMark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义计算问题
|
||||
/// </summary>
|
||||
public string CalculateQuestions { get; set; } = "[]";
|
||||
|
||||
/// <summary>
|
||||
/// 小数点位数
|
||||
/// </summary>
|
||||
public int? DigitPlaces { get; set; }
|
||||
[NotMapped]
|
||||
public List<CalculateInfo> CalculateQuestionList
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var result = JsonConvert.DeserializeObject<List<CalculateInfo>>(this.CalculateQuestions);
|
||||
return result == null ? new List<CalculateInfo>() : result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return new List<CalculateInfo>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 小数点位数
|
||||
/// </summary>
|
||||
public int? DigitPlaces { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
|
|
Loading…
Reference in New Issue