修改一版
parent
4e060c7093
commit
a9afb9a478
|
@ -166,6 +166,18 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public Guid ReadingId { get; set; }
|
||||
|
||||
public UploadRole? UploadRole { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是访视
|
||||
/// </summary>
|
||||
public bool IsVisit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是基线
|
||||
/// </summary>
|
||||
public bool IsBaseLine { get; set; }
|
||||
}
|
||||
|
||||
public class GetReadingClinicalDataPDFListIndto:PageInput
|
||||
|
|
|
@ -138,14 +138,14 @@ namespace IRaCIS.Application.Services
|
|||
Path=x.ClinicalDataTrialSet.Path,
|
||||
}).ToListAsync() ;
|
||||
|
||||
PageOutput<GetReadingClinicalDataListOutDto> clinicalData = await this.GetReadingClinicalDataList(new GetReadingClinicalDataListIndto()
|
||||
PageOutput<GetReadingClinicalDataListOutDto> clinicalData = (await this.GetReadingClinicalDataList(new GetReadingClinicalDataListIndto()
|
||||
{
|
||||
PageIndex = 1,
|
||||
PageSize = 9999,
|
||||
SubjectId = inDto.SubjectId,
|
||||
ReadingId = inDto.SubjectVisitId,
|
||||
|
||||
});
|
||||
TrialId=inDto.TrialId,
|
||||
})).Item1;
|
||||
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousOtherList = await _previousOtherRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId).ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
@ -285,26 +285,23 @@ namespace IRaCIS.Application.Services
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<GetReadingClinicalDataListOutDto>> GetReadingClinicalDataList(GetReadingClinicalDataListIndto inDto)
|
||||
public async Task<(PageOutput<GetReadingClinicalDataListOutDto>,object)> GetReadingClinicalDataList(GetReadingClinicalDataListIndto inDto)
|
||||
{
|
||||
//var userPMTypes = new List<int>() {
|
||||
// (int)UserTypeEnum.ProjectManager,
|
||||
// (int)UserTypeEnum.SPM,
|
||||
// (int)UserTypeEnum.CPM,
|
||||
// (int)UserTypeEnum.IndependentReviewer,
|
||||
// };
|
||||
GetTrialClinicalDataSelectIndto getTrialClinicalDataSelectIndto = new GetTrialClinicalDataSelectIndto()
|
||||
{
|
||||
ReadingId = inDto.ReadingId,
|
||||
TrialId = inDto.TrialId,
|
||||
IsBaseLine = inDto.IsBaseLine,
|
||||
SubjectId = inDto.SubjectId,
|
||||
IsVisit = inDto.IsVisit,
|
||||
};
|
||||
|
||||
//if (userPMTypes.Contains(_userInfo.UserTypeEnumInt))
|
||||
//{
|
||||
// inDto.UploadRole = UploadRole.PM;
|
||||
//}
|
||||
var clinicalDataList = await this.GetTrialClinicalDataSelect(getTrialClinicalDataSelectIndto);
|
||||
|
||||
//else
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC)
|
||||
{
|
||||
inDto.UploadRole = UploadRole.CRC;
|
||||
}
|
||||
|
||||
var isBaseLine = await _subjectVisitRepository.AnyAsync(x => x.Id == inDto.ReadingId && x.IsBaseLine);
|
||||
var resultQuery = _readingClinicalDataRepository.Where(x => x.SubjectId == inDto.SubjectId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||
|
@ -331,14 +328,9 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var result=await resultQuery.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(GetReadingClinicalDataListOutDto.ClinicalDataSetName) : inDto.SortField,
|
||||
inDto.Asc);
|
||||
|
||||
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousOtherList = await _previousOtherRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousOtherView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var previousSurgeryList = await _previousSurgeryRepository.Where(x => x.SubjectVisitId == inDto.ReadingId).ProjectTo<PreviousSurgeryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
|
||||
foreach (var item in result.CurrentPageData)
|
||||
{
|
||||
item.ClinicalTableData = new ClinicalDataTable()
|
||||
|
@ -350,7 +342,9 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
}
|
||||
|
||||
return result;
|
||||
return (result, new {
|
||||
isCanAddClinicalData= clinicalDataList.Count()>0,
|
||||
}) ;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ using IRaCIS.Core.Application.Service.Reading;
|
|||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using Panda.DynamicWebApi.Attributes;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -30,6 +31,7 @@ namespace IRaCIS.Application.Services
|
|||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository;
|
||||
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IReadingImageTaskService _readingImageTaskService;
|
||||
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswer;
|
||||
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||
|
@ -43,6 +45,7 @@ namespace IRaCIS.Application.Services
|
|||
IRepository<ClinicalDataTrialSet> ClinicalDataTrialSetRepository,
|
||||
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
||||
IRepository<Dictionary> dictionaryRepository,
|
||||
IRepository<Trial> trialRepository,
|
||||
IReadingImageTaskService readingImageTaskService,
|
||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswer,
|
||||
IRepository<PreviousPDF> previousPDFRepository
|
||||
|
@ -56,6 +59,7 @@ namespace IRaCIS.Application.Services
|
|||
this._clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
|
||||
this._clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
|
||||
this._dictionaryRepository = dictionaryRepository;
|
||||
this._trialRepository = trialRepository;
|
||||
this._readingImageTaskService = readingImageTaskService;
|
||||
this._readingTaskQuestionAnswer = readingTaskQuestionAnswer;
|
||||
this._previousPDFRepository = previousPDFRepository;
|
||||
|
@ -131,28 +135,28 @@ namespace IRaCIS.Application.Services
|
|||
// return ResponseOutput.Ok(result);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 验证系统问题是否设置裁判答案
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> VerifySystemQuestionIsSetJudgeAnswer(VerifySystemQuestionIsSetJudgeAnswerInDto inDto)
|
||||
{
|
||||
var result = await _readingQuestionTrialRepository.AnyAsync(x => x.ReadingQuestionSystemId == inDto.Id&&x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None);
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
///// <summary>
|
||||
///// 验证系统问题是否设置裁判答案
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<IResponseOutput> VerifySystemQuestionIsSetJudgeAnswer(VerifySystemQuestionIsSetJudgeAnswerInDto inDto)
|
||||
//{
|
||||
// var result = await _readingQuestionTrialRepository.AnyAsync(x => x.ReadingQuestionSystemId == inDto.Id&&x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None);
|
||||
// return ResponseOutput.Ok(result);
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 验证项目问题是否设置裁判答案
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> VerifyTrialQuestionIsSetJudgeAnswer(VerifySystemQuestionIsSetJudgeAnswerInDto inDto)
|
||||
{
|
||||
var result = await _readingQuestionTrialRepository.AnyAsync(x => x.Id == inDto.Id && x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None);
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
///// <summary>
|
||||
///// 验证项目问题是否设置裁判答案
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<IResponseOutput> VerifyTrialQuestionIsSetJudgeAnswer(VerifySystemQuestionIsSetJudgeAnswerInDto inDto)
|
||||
//{
|
||||
// var result = await _readingQuestionTrialRepository.AnyAsync(x => x.Id == inDto.Id && x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None);
|
||||
// return ResponseOutput.Ok(result);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 设置系统问题标准是否完成配置
|
||||
|
@ -377,6 +381,17 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingQuestionSystem(AddOrUpdateReadingQuestionSystemInDto indto)
|
||||
{
|
||||
if (indto.Id != null)
|
||||
{
|
||||
var trialIdList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionSystemId == indto.Id && x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None)
|
||||
.Select(x => x.TrialId).ToListAsync();
|
||||
|
||||
if (trialIdList.Count>0)
|
||||
{
|
||||
var trialNames = await _trialRepository.Where(x => trialIdList.Contains(x.Id)).Select(x => x.ExperimentName).ToListAsync();
|
||||
throw new BusinessValidationFailedException("当前问题在项目"+ string.Join(',', trialNames) + "设置了裁判标准了,修改失败");
|
||||
}
|
||||
}
|
||||
var entity = await _readingQuestionSystemRepository.InsertOrUpdateAsync(indto, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
@ -676,6 +691,13 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingQuestionTrial(AddOrUpdateReadingQuestionTrialInDto indto)
|
||||
{
|
||||
if (indto.Id != null)
|
||||
{
|
||||
if (await _readingQuestionTrialRepository.AnyAsync(x => x.Id == indto.Id && x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None))
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前问题已经设置了裁判标准了,修改失败");
|
||||
}
|
||||
}
|
||||
var entity = await _readingQuestionTrialRepository.InsertOrUpdateAsync(indto, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue