Uat_Study
parent
9f39b2cad6
commit
594849529c
|
@ -117,6 +117,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public int? ParentShowOrder { get; set; }
|
public int? ParentShowOrder { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 任务类型
|
||||||
|
/// </summary>
|
||||||
|
public ReadingCategory ReadingCategory { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace IRaCIS.Application.Services
|
||||||
OnlyExistsMedicalHistory = !(await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataSetName != "既往局部治疗史" && x.IsConfirm)),
|
OnlyExistsMedicalHistory = !(await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataSetName != "既往局部治疗史" && x.IsConfirm)),
|
||||||
IsExistsSubjectClinicalData= await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId&&x.ClinicalDataLevel== ClinicalLevel.Subject && x.IsConfirm),
|
IsExistsSubjectClinicalData= await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId&&x.ClinicalDataLevel== ClinicalLevel.Subject && x.IsConfirm),
|
||||||
IsExistsVisitClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataLevel == ClinicalLevel.SubjectVisit && x.IsConfirm),
|
IsExistsVisitClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataLevel == ClinicalLevel.SubjectVisit && x.IsConfirm),
|
||||||
IsExistsReadingClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataLevel == ClinicalLevel.Read && x.IsConfirm),
|
IsExistsReadingClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataLevel == ClinicalLevel.ImageRead && x.IsConfirm),
|
||||||
IsGlobalReading= trialinfo.IsGlobalReading,
|
IsGlobalReading= trialinfo.IsGlobalReading,
|
||||||
|
|
||||||
}) ;
|
}) ;
|
||||||
|
|
|
@ -137,7 +137,7 @@ namespace IRaCIS.Application.Services
|
||||||
await this.AddCRCClinicalData(inDto);
|
await this.AddCRCClinicalData(inDto);
|
||||||
|
|
||||||
List<GetCRCClinicalDataOutDto> cRCClinicalDataList = await _readingClinicalDataRepository.Where(x => x.ReadingId == inDto.SubjectVisitId)
|
List<GetCRCClinicalDataOutDto> cRCClinicalDataList = await _readingClinicalDataRepository.Where(x => x.ReadingId == inDto.SubjectVisitId)
|
||||||
.Where(x => x.ClinicalDataTrialSet.TrialId == inDto.TrialId && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Read && x.ClinicalDataTrialSet.IsConfirm)
|
.Where(x => x.ClinicalDataTrialSet.TrialId == inDto.TrialId && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.ImageRead && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.OncologyRead && x.ClinicalDataTrialSet.IsConfirm)
|
||||||
.Select(x => new GetCRCClinicalDataOutDto()
|
.Select(x => new GetCRCClinicalDataOutDto()
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
|
@ -180,7 +180,7 @@ namespace IRaCIS.Application.Services
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task AddCRCClinicalData(GetCRCClinicalDataInDto inDto)
|
private async Task AddCRCClinicalData(GetCRCClinicalDataInDto inDto)
|
||||||
{
|
{
|
||||||
var cRCClinicalDataIds = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.UploadRole == UploadRole.CRC && x.ClinicalDataLevel != ClinicalLevel.Read && x.IsConfirm).Select(x => x.Id).ToListAsync();
|
var cRCClinicalDataIds = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.UploadRole == UploadRole.CRC && x.ClinicalDataLevel != ClinicalLevel.ImageRead && x.ClinicalDataLevel != ClinicalLevel.OncologyRead && x.IsConfirm).Select(x => x.Id).ToListAsync();
|
||||||
|
|
||||||
var needAddIds = cRCClinicalDataIds.Where(x => _readingClinicalDataRepository.Where(y => y.ReadingId == inDto.SubjectVisitId && x == y.ClinicalDataTrialSetId).Count() == 0).ToList();
|
var needAddIds = cRCClinicalDataIds.Where(x => _readingClinicalDataRepository.Where(y => y.ReadingId == inDto.SubjectVisitId && x == y.ClinicalDataTrialSetId).Count() == 0).ToList();
|
||||||
|
|
||||||
|
@ -248,7 +248,15 @@ namespace IRaCIS.Application.Services
|
||||||
inDto.UploadRole = UploadRole.PM;
|
inDto.UploadRole = UploadRole.PM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReadModule readModule = null;
|
||||||
|
if (inDto.ReadingId != null)
|
||||||
|
{
|
||||||
|
readModule = await _readModuleRepository.Where(x => x.Id ==inDto.ReadingId).FirstNotNullAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<ModuleTypeEnum, ClinicalLevel> keyValuePairs = new Dictionary<ModuleTypeEnum, ClinicalLevel>();
|
||||||
|
keyValuePairs.Add(ModuleTypeEnum.Global, ClinicalLevel.ImageRead);
|
||||||
|
keyValuePairs.Add(ModuleTypeEnum.Oncology, ClinicalLevel.OncologyRead);
|
||||||
|
|
||||||
var usedIdsQuery = _readingClinicalDataRepository.Where(x => x.ReadingId == inDto.ReadingId && x.Id != inDto.ReadingClinicalDataId).Select(x => x.ClinicalDataTrialSetId);
|
var usedIdsQuery = _readingClinicalDataRepository.Where(x => x.ReadingId == inDto.ReadingId && x.Id != inDto.ReadingClinicalDataId).Select(x => x.ClinicalDataTrialSetId);
|
||||||
List<GetTrialClinicalDataSelectOutDto> clinicalList = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm)
|
List<GetTrialClinicalDataSelectOutDto> clinicalList = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm)
|
||||||
|
@ -256,7 +264,8 @@ namespace IRaCIS.Application.Services
|
||||||
.Where(x => !usedIdsQuery.Contains(x.Id))
|
.Where(x => !usedIdsQuery.Contains(x.Id))
|
||||||
.WhereIf(inDto.IsVisit && inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
.WhereIf(inDto.IsVisit && inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||||
.WhereIf(inDto.IsVisit && !inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
.WhereIf(inDto.IsVisit && !inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||||
.WhereIf(!inDto.IsVisit, x => x.ClinicalDataLevel == ClinicalLevel.Read)
|
.WhereIf(!inDto.IsVisit, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead||x.ClinicalDataLevel==ClinicalLevel.OncologyRead)
|
||||||
|
.WhereIf(readModule!=null, x => x.ClinicalDataLevel == keyValuePairs[readModule.ModuleType])
|
||||||
.Select(x => new GetTrialClinicalDataSelectOutDto()
|
.Select(x => new GetTrialClinicalDataSelectOutDto()
|
||||||
{
|
{
|
||||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||||
|
|
|
@ -7,6 +7,7 @@ using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
@ -220,7 +221,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var needList= systemList.Select(x => new ReadingMedicineTrialQuestion()
|
var needList= systemList.Select(x => new ReadingMedicineTrialQuestion()
|
||||||
{
|
{
|
||||||
Id = NewId.NextGuid(),
|
Id = NewId.NextGuid(),
|
||||||
ShowOrder = maxOrder++,
|
ShowOrder = x.ShowOrder,
|
||||||
IsEnable = x.IsEnable,
|
IsEnable = x.IsEnable,
|
||||||
IsRequired = x.IsRequired,
|
IsRequired = x.IsRequired,
|
||||||
QuestionName = x.QuestionName,
|
QuestionName = x.QuestionName,
|
||||||
|
@ -230,7 +231,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
TrialId=inDto.TrialId,
|
TrialId=inDto.TrialId,
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
needList.ForEach(x => {
|
||||||
|
x.ShowOrder = maxOrder++;
|
||||||
|
});
|
||||||
|
|
||||||
await _readingMedicineTrialQuestionRepository.AddRangeAsync(needList);
|
await _readingMedicineTrialQuestionRepository.AddRangeAsync(needList);
|
||||||
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
||||||
|
@ -264,8 +267,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId)
|
var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||||
.Select(x => new TrialQuestion() {
|
.Select(x => new TrialQuestion() {
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
|
ReadingCategory = x.ReadingCategory,
|
||||||
ParentShowOrder = (int?)x.ParentQuestion.ShowOrder,
|
ParentShowOrder = (int?)x.ParentQuestion.ShowOrder,
|
||||||
ShowOrder=x.ShowOrder,
|
ShowOrder = x.ShowOrder,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
if (readingMedicineQuestionList.Count == 0)
|
if (readingMedicineQuestionList.Count == 0)
|
||||||
{
|
{
|
||||||
|
@ -284,6 +288,25 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var trialInfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
if (trialInfo.IsGlobalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Global))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前项目启用了全局阅片,但未配置全局医学审核问题");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trialInfo.IsArbitrationReading??false && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Judge))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前项目启用了仲裁阅片,但未配置仲裁医学审核问题");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trialInfo.IsClinicalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Oncology))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前项目启用了肿瘤学阅片,但未配置肿瘤学医学审核问题");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await _readingMedicineTrialQuestionRepository.BatchUpdateNoTrackingAsync(x => x.TrialId == inDto.TrialId, x => new ReadingMedicineTrialQuestion()
|
await _readingMedicineTrialQuestionRepository.BatchUpdateNoTrackingAsync(x => x.TrialId == inDto.TrialId, x => new ReadingMedicineTrialQuestion()
|
||||||
{
|
{
|
||||||
IsConfirm = true
|
IsConfirm = true
|
||||||
|
|
|
@ -173,10 +173,16 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
SubjectVisit = 1,
|
SubjectVisit = 1,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 阅片
|
/// 影像学阅片
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayAttribute(Name = "阅片")]
|
[DisplayAttribute(Name = "影像学阅片")]
|
||||||
Read = 2,
|
ImageRead = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 肿瘤学阅片
|
||||||
|
/// </summary>
|
||||||
|
[DisplayAttribute(Name = "肿瘤学阅片")]
|
||||||
|
OncologyRead = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue