108 lines
3.9 KiB
C#
108 lines
3.9 KiB
C#
//using IRaCIS.Application.Interfaces;
|
|
//using IRaCIS.Core.Infra.EFCore;
|
|
//using IRaCIS.Core.Domain.Share;
|
|
//using IRaCIS.Core.Application.Filter;
|
|
//using Microsoft.AspNetCore.Mvc;
|
|
//using IRaCIS.Core.Application.Service.WorkLoad.DTO;
|
|
//using Microsoft.AspNetCore.Authorization;
|
|
//using IRaCIS.Core.Application.Auth;
|
|
//using IRaCIS.Core.Application.Service.Reading.Dto;
|
|
//using IRaCIS.Core.Domain.Share.Reading;
|
|
|
|
//namespace IRaCIS.Application.Services
|
|
//{
|
|
// /// <summary>
|
|
// /// 临床数据
|
|
// /// </summary>
|
|
// [ApiExplorerSettings(GroupName = "Reading")]
|
|
// public class ClinicalDataService : BaseService
|
|
// {
|
|
|
|
// public IRepository<SubjectVisit> _subjectVisitRepository;
|
|
// private readonly IRepository<ClinicalData> _clinicalDataRepository;
|
|
// private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
|
|
|
// public ClinicalDataService(IRepository<SubjectVisit> subjectVisitRepository,
|
|
// IRepository<ClinicalData> clinicalDataRepository,
|
|
// IRepository<PreviousPDF> previousPDFRepository
|
|
// )
|
|
// {
|
|
// _subjectVisitRepository = subjectVisitRepository;
|
|
// _clinicalDataRepository = clinicalDataRepository;
|
|
// this._previousPDFRepository = previousPDFRepository;
|
|
// }
|
|
|
|
|
|
// /// <summary>
|
|
// /// 新增或者修改
|
|
// /// </summary>
|
|
// /// <param name="addOrEditClinicalData"></param>
|
|
// /// <returns></returns>
|
|
// [HttpPost]
|
|
// public async Task<IResponseOutput> AddOrUpdateClinicalDataService(ClinicalDataAddOrEdit addOrEditClinicalData)
|
|
// {
|
|
// var entity = await _repository.InsertOrUpdateAsync<ClinicalData, ClinicalDataAddOrEdit>(addOrEditClinicalData, true);
|
|
// return ResponseOutput.Ok(entity.Id.ToString());
|
|
// }
|
|
|
|
// /// <summary>
|
|
// /// 分页获取
|
|
// /// </summary>
|
|
// /// <param name="query"></param>
|
|
// /// <returns></returns>
|
|
// [HttpPost]
|
|
// public async Task<PageOutput<ClinicalDataView>> GetClinicalDataList(ClinicalDataQuery query)
|
|
// {
|
|
|
|
// var readquery = _clinicalDataRepository.AsQueryable()
|
|
// .WhereIf(query.TrialId!=null,x=>x.TrialId==query.TrialId)
|
|
// .ProjectTo<ClinicalDataView>(_mapper.ConfigurationProvider);
|
|
// var pageList= await readquery.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField == null ? "CreateTime" : query.SortField,
|
|
// query.SortAsc);
|
|
|
|
// return pageList;
|
|
// }
|
|
|
|
|
|
|
|
// /// <summary>
|
|
// /// 获取
|
|
// /// </summary>
|
|
// /// <param name="query"></param>
|
|
// /// <returns></returns>
|
|
// [HttpPost]
|
|
// public async Task<dynamic> ClinicalDataView(ClinicalDataInDto inDto)
|
|
// {
|
|
// var list= await _previousPDFRepository.AsQueryable().Where(x => x.TrialId == inDto.TrialId)
|
|
// .Where(x => (x.ClinicalLevel == ClinicalLevel.Subject && x.SubjectId == inDto.SubjectId) || x.SubjectVisitId == inDto.VisitOrReadId)
|
|
// .Select(x=>new {
|
|
// x.Path,
|
|
// x.DataType,
|
|
// x.CreateTime,
|
|
// x.ClinicalLevel,
|
|
// x.FileName,
|
|
// x.UploadType,
|
|
// x.Id,
|
|
// })
|
|
// .ToListAsync();
|
|
// return list;
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// /// <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);
|
|
// return ResponseOutput.Result(success);
|
|
// }
|
|
// }
|
|
//}
|