修改
This commit is contained in:
@@ -100,35 +100,6 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置勾选
|
||||
/// </summary>
|
||||
/// <param name="setClinicalData"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> SetClinicalDataCheckd(SetClinicalDataCheckdIndto setClinicalData)
|
||||
{
|
||||
// 为了后面稽查这样写
|
||||
var nocheckids =await _clinicalDataTrialSetRepository.Where(x => x.TrialId == setClinicalData.TrialId && !setClinicalData.ClinicalDataTrialIds.Contains(x.Id)).Select(x => x.Id).ToListAsync();
|
||||
foreach (var item in setClinicalData.ClinicalDataTrialIds)
|
||||
{
|
||||
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(item, x => new ClinicalDataTrialSet()
|
||||
{
|
||||
IsCheck = true
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var item in nocheckids)
|
||||
{
|
||||
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(item, x => new ClinicalDataTrialSet()
|
||||
{
|
||||
IsCheck = false
|
||||
});
|
||||
}
|
||||
|
||||
await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将系统配置添加到项目配置
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 对象ID
|
||||
/// 阅片ID
|
||||
/// </summary>
|
||||
public Guid objectId { get; set; }
|
||||
public Guid ReadingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 临床数据类型Id
|
||||
@@ -37,15 +37,32 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// 临床数据类型Id
|
||||
/// </summary>
|
||||
public bool IsVisit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件列表
|
||||
/// </summary>
|
||||
public List<FileDto> FileList { get; set; }
|
||||
}
|
||||
|
||||
public class FileDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件名称
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 路径
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取访视列表
|
||||
/// </summary>
|
||||
public class GetReadingClinicalDataListIndto :PageInput
|
||||
{
|
||||
public Guid ObjectId { get; set; }
|
||||
public Guid ReadingId { get; set; }
|
||||
}
|
||||
|
||||
public class GetReadingClinicalDataPDFListIndto:PageInput
|
||||
@@ -65,7 +82,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// <summary>
|
||||
/// 对象ID
|
||||
/// </summary>
|
||||
public Guid ObjectId { get; set; }
|
||||
public Guid ReadingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 受试者ID
|
||||
@@ -108,7 +125,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// <summary>
|
||||
/// 对象ID
|
||||
/// </summary>
|
||||
public Guid ObjectId { get; set; }
|
||||
public Guid ReadingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 受试者ID
|
||||
@@ -185,8 +202,27 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public class GetTrialClinicalDataSelectIndto
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 阅片期临床数据ID
|
||||
/// </summary>
|
||||
public Guid? ReadingClinicalDataId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 对象ID
|
||||
/// </summary>
|
||||
public Guid ReadingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是访视
|
||||
/// </summary>
|
||||
public bool IsVisit { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class GetTrialClinicalDataSelectOutDto
|
||||
{
|
||||
|
||||
@@ -44,13 +44,50 @@ namespace IRaCIS.Application.Services
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingClinicalData(AddOrUpdateReadingClinicalDataDto indto)
|
||||
{
|
||||
var entity = await _readingClinicalDataRepository.InsertOrUpdateAsync(indto,true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
|
||||
|
||||
if (indto.Id == null)
|
||||
{
|
||||
var entity = _mapper.Map<ReadingClinicalData>(indto);
|
||||
entity.ReadingClinicalDataPDFList = indto.FileList.Select(x => new ReadingClinicalDataPDF()
|
||||
{
|
||||
|
||||
TrialId = entity.TrialId,
|
||||
SubjectId= indto.SubjectId,
|
||||
FileName=x.FileName,
|
||||
Path=x.Path,
|
||||
IsVisit= indto.IsVisit,
|
||||
ReadingId=indto.ReadingId
|
||||
}).ToList();
|
||||
|
||||
|
||||
await _readingClinicalDataRepository.AddAsync(entity, true);
|
||||
return ResponseOutput.Ok(entity.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = (await _readingClinicalDataRepository.Where(t => t.Id == indto.Id, true).Include(t => t.ReadingClinicalDataPDFList).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
_mapper.Map(indto, entity);
|
||||
|
||||
entity.ReadingClinicalDataPDFList = indto.FileList.Select(x => new ReadingClinicalDataPDF()
|
||||
{
|
||||
|
||||
TrialId = entity.TrialId,
|
||||
SubjectId = indto.SubjectId,
|
||||
FileName = x.FileName,
|
||||
Path = x.Path,
|
||||
IsVisit = indto.IsVisit,
|
||||
ReadingId = indto.ReadingId
|
||||
}).ToList();
|
||||
|
||||
var success = await _readingClinicalDataRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(entity.Id);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
@@ -64,7 +101,6 @@ namespace IRaCIS.Application.Services
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取下拉菜单
|
||||
/// </summary>
|
||||
@@ -73,7 +109,12 @@ namespace IRaCIS.Application.Services
|
||||
[HttpPost]
|
||||
public async Task<List<GetTrialClinicalDataSelectOutDto>> GetTrialClinicalDataSelect(GetTrialClinicalDataSelectIndto inDto)
|
||||
{
|
||||
List<GetTrialClinicalDataSelectOutDto> clinicalList = await _clinicalDataTrialSetRepository.Select(x => new GetTrialClinicalDataSelectOutDto()
|
||||
|
||||
List<GetTrialClinicalDataSelectOutDto> clinicalList = await _clinicalDataTrialSetRepository
|
||||
|
||||
//.WhereIf(inDto.ReadingClinicalDataId==null, x=> _readingClinicalDataPDFRepository.Where(y=>y.ObjectId==inDto.ObjectId&&))
|
||||
|
||||
.Select(x => new GetTrialClinicalDataSelectOutDto()
|
||||
{
|
||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||
ClinicalDataSetName = x.ClinicalDataSetName,
|
||||
@@ -96,7 +137,7 @@ namespace IRaCIS.Application.Services
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<GetReadingClinicalDataListOutDto>> GetReadingClinicalDataList(GetReadingClinicalDataListIndto inDto)
|
||||
{
|
||||
var result = await _readingClinicalDataRepository.Where(x => x.ObjectId == inDto.ObjectId).ProjectTo<GetReadingClinicalDataListOutDto>(_mapper.ConfigurationProvider).ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(GetReadingClinicalDataListOutDto.ClinicalDataSetName) : inDto.SortField,
|
||||
var result = await _readingClinicalDataRepository.ProjectTo<GetReadingClinicalDataListOutDto>(_mapper.ConfigurationProvider).ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? nameof(GetReadingClinicalDataListOutDto.ClinicalDataSetName) : inDto.SortField,
|
||||
inDto.Asc);
|
||||
|
||||
result.CurrentPageData.ForEach(x => {
|
||||
@@ -123,21 +164,21 @@ namespace IRaCIS.Application.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增或者修改PDF
|
||||
/// </summary>
|
||||
/// <param name="indto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingClinicalDataPDF(AddOrUpdateReadingClinicalDataPDFDto indto)
|
||||
{
|
||||
var entity = await _readingClinicalDataPDFRepository.InsertOrUpdateAsync(indto, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
///// <summary>
|
||||
///// 新增或者修改PDF
|
||||
///// </summary>
|
||||
///// <param name="indto"></param>
|
||||
///// <returns></returns>
|
||||
//[HttpPost]
|
||||
//public async Task<IResponseOutput> AddOrUpdateReadingClinicalDataPDF(AddOrUpdateReadingClinicalDataPDFDto indto)
|
||||
//{
|
||||
// var entity = await _readingClinicalDataPDFRepository.InsertOrUpdateAsync(indto, true);
|
||||
// return ResponseOutput.Ok(entity.Id.ToString());
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除PDF
|
||||
/// 删除PDF单个文件
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
Reference in New Issue
Block a user