Test.EIImageViewer
parent
9f39b2cad6
commit
594849529c
|
@ -117,6 +117,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public int? ParentShowOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务类型
|
||||
/// </summary>
|
||||
public ReadingCategory ReadingCategory { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -205,7 +205,7 @@ namespace IRaCIS.Application.Services
|
|||
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),
|
||||
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,
|
||||
|
||||
}) ;
|
||||
|
|
|
@ -137,7 +137,7 @@ namespace IRaCIS.Application.Services
|
|||
await this.AddCRCClinicalData(inDto);
|
||||
|
||||
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()
|
||||
{
|
||||
Id = x.Id,
|
||||
|
@ -180,7 +180,7 @@ namespace IRaCIS.Application.Services
|
|||
/// <returns></returns>
|
||||
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();
|
||||
|
||||
|
@ -248,7 +248,15 @@ namespace IRaCIS.Application.Services
|
|||
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);
|
||||
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))
|
||||
.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, 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()
|
||||
{
|
||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||
|
|
|
@ -7,6 +7,7 @@ using IRaCIS.Core.Infra.EFCore.Common;
|
|||
using MassTransit;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -220,7 +221,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var needList= systemList.Select(x => new ReadingMedicineTrialQuestion()
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
ShowOrder = maxOrder++,
|
||||
ShowOrder = x.ShowOrder,
|
||||
IsEnable = x.IsEnable,
|
||||
IsRequired = x.IsRequired,
|
||||
QuestionName = x.QuestionName,
|
||||
|
@ -230,7 +231,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
TrialId=inDto.TrialId,
|
||||
}).ToList();
|
||||
|
||||
|
||||
needList.ForEach(x => {
|
||||
x.ShowOrder = maxOrder++;
|
||||
});
|
||||
|
||||
await _readingMedicineTrialQuestionRepository.AddRangeAsync(needList);
|
||||
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
||||
|
@ -255,18 +258,19 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 确认医学审核问题
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> ConfirmReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto)
|
||||
{
|
||||
/// <summary>
|
||||
/// 确认医学审核问题
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> ConfirmReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto)
|
||||
{
|
||||
var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.Select(x => new TrialQuestion() {
|
||||
Id = x.Id,
|
||||
ReadingCategory = x.ReadingCategory,
|
||||
ParentShowOrder = (int?)x.ParentQuestion.ShowOrder,
|
||||
ShowOrder=x.ShowOrder,
|
||||
}).ToListAsync();
|
||||
ShowOrder = x.ShowOrder,
|
||||
}).ToListAsync();
|
||||
if (readingMedicineQuestionList.Count == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前未添加医学审核问题。请先添加医学审核问题,再进行确认。");
|
||||
|
@ -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()
|
||||
{
|
||||
IsConfirm = true
|
||||
|
|
|
@ -173,10 +173,16 @@ namespace IRaCIS.Core.Domain.Share
|
|||
SubjectVisit = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 阅片
|
||||
/// 影像学阅片
|
||||
/// </summary>
|
||||
[DisplayAttribute(Name = "阅片")]
|
||||
Read = 2,
|
||||
[DisplayAttribute(Name = "影像学阅片")]
|
||||
ImageRead = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 肿瘤学阅片
|
||||
/// </summary>
|
||||
[DisplayAttribute(Name = "肿瘤学阅片")]
|
||||
OncologyRead = 3,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue