修改一版

This commit is contained in:
he
2022-05-31 15:38:12 +08:00
parent 3d15d8ce31
commit 2690536904
13 changed files with 192 additions and 63 deletions
@@ -60,14 +60,31 @@ namespace IRaCIS.Application.Services
return pageList;
}
/// <summary>
/// 获取
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<ClinicalDataView>> ClinicalDataView(ClinicalDataInDto inDto)
{
var list= await _clinicalDataRepository.AsQueryable().Where(x => x.TrialId == inDto.TrialId)
.Where(x => (x.ClinicalLevel == ClinicalLevel.Subject && x.SubjectId == inDto.SubjectId) || x.VisitOrReadId == inDto.VisitOrReadId)
.ProjectTo<ClinicalDataView>(_mapper.ConfigurationProvider)
.ToListAsync();
return list;
}
/// <summary>
/// 删除
/// </summary>
/// <param name="ClinicalDataId"></param>
/// <returns></returns>
[HttpDelete("{ClinicalDataId:guid}")]
/// <summary>
/// 删除
/// </summary>
/// <param name="clinicalDataId"></param>
/// <returns></returns>
[HttpDelete("{ClinicalDataId:guid}")]
public async Task<IResponseOutput> DeleteClinicalData(Guid clinicalDataId)
{
var success = await _repository.BatchDeleteAsync<ClinicalData>(t => t.Id == clinicalDataId);
@@ -18,6 +18,23 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
}
public class ClinicalDataInDto
{
/// <summary>
/// 项目Id
/// </summary>
public Guid TrialId { get; set; }
/// <summary>
/// 受试者ID
/// </summary>
public Guid SubjectId { get; set; }
/// <summary>
/// 访视或者阅片ID
/// </summary>
public Guid VisitOrReadId { get; set; }
}
public class ClinicalDataQuery
{
/// <summary>
@@ -18,6 +18,19 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
}
public class SetReadingPeriodSetEffect
{
/// <summary>
/// 项目ID
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// 设置阅片是否生效
/// </summary>
public bool IsTakeEffect { get; set; }
}
public class ReadingPeriodSetQuery
{
@@ -11,6 +11,9 @@ using IRaCIS.Core.Domain.Share.Reading;
namespace IRaCIS.Application.Services
{
/// <summary>
/// 生成的阅片模块(在大列表上展示的)
/// </summary>
[ApiExplorerSettings(GroupName = "Reading")]
public class ReadModuleService : BaseService
{
@@ -31,9 +34,8 @@ namespace IRaCIS.Application.Services
/// 获取读片模块
/// </summary>
[HttpPost]
public async Task<GetReadModuleResultDto> GetReadModule(GetReadModuleDto dto)
public async Task<(PageOutput<GetReadModuleDtoOut>,int)> GetReadModule(GetReadModuleDto dto)
{
var subjectquery = _subjectRepository.WhereIf(dto.TrialId!=null, x => x.TrialId == dto.TrialId).Include(x => x.SubjectVisitList).Include(x=>x.Site)
.Select(x => new GetReadModuleDtoOut
{
@@ -56,27 +58,10 @@ namespace IRaCIS.Application.Services
VisitName = y.VisitName,
}).ToList()
});
var pageList = await subjectquery.ToPagedListAsync(dto.PageIndex, dto.PageSize, dto.SortField == null ? "SiteCode" : dto.SortField,
dto.SortAsc);
GetReadModuleResultDto resultDto = new GetReadModuleResultDto()
{
CurrentPageData = pageList.CurrentPageData.ToList(),
PageSize = pageList.PageSize,
MaxLength = pageList.CurrentPageData.ToList().Max(x => x.Data.Count),
PageIndex = pageList.PageIndex,
TotalCount = pageList.TotalCount,
};
return resultDto;
return (pageList, pageList.CurrentPageData.ToList().Max(x => x.Data.Count));
}
@@ -11,6 +11,9 @@ using IRaCIS.Core.Domain.Share.Reading;
namespace IRaCIS.Application.Services
{
/// <summary>
/// 阅片期配置
/// </summary>
[ApiExplorerSettings(GroupName = "Reading")]
public class ReadingPeriodSetService : BaseService
{
@@ -59,13 +62,31 @@ namespace IRaCIS.Application.Services
}
/// <summary>
/// 设置阅片期配置是否生效
/// </summary>
/// <param name="indto"></param>
/// <returns></returns>
[HttpPut]
public async Task SetReadingPeriodSetEffect(SetReadingPeriodSetEffect indto)
{
/// <summary>
/// 删除
/// </summary>
/// <param name="readingPeriodSetId"></param>
/// <returns></returns>
[HttpDelete("{readingPeriodSetId:guid}")]
var readquery =await _readingPeriodSetRepository.UpdatePartialNowNoQueryAsync(indto.Id, x => new ReadingPeriodSet() {
IsTakeEffect = indto.IsTakeEffect
});
await _readingPeriodSetRepository.SaveChangesAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="readingPeriodSetId"></param>
/// <returns></returns>
[HttpDelete("{readingPeriodSetId:guid}")]
public async Task<IResponseOutput> DeleteReadingPeriodSet(Guid readingPeriodSetId)
{
var success = await _repository.BatchDeleteAsync<ReadingPeriodSet>(t => t.Id == readingPeriodSetId);