修改一版
parent
19f3c1fe5a
commit
450d6e1828
|
@ -208,19 +208,19 @@ namespace IRaCIS.Core.API.Controllers
|
|||
public IMapper _mapper { get; set; }
|
||||
public IUserInfo _userInfo { get; set; }
|
||||
private readonly IMediator _mediator;
|
||||
private readonly IRepository<ClinicalData> _clinicalDataRepository;
|
||||
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
|
||||
private readonly IRepository _repository;
|
||||
|
||||
|
||||
public StudyController(IMapper mapper, IUserInfo userInfo, IWebHostEnvironment hostEnvironment, IMediator mediator,
|
||||
IRepository<ClinicalData> clinicalDataRepository,
|
||||
|
||||
IRepository repository)
|
||||
{
|
||||
_hostEnvironment = hostEnvironment;
|
||||
_mediator = mediator;
|
||||
this._clinicalDataRepository = clinicalDataRepository;
|
||||
|
||||
_mapper = mapper;
|
||||
_userInfo = userInfo;
|
||||
_repository = repository;
|
||||
|
|
|
@ -1,107 +0,0 @@
|
|||
//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);
|
||||
// }
|
||||
// }
|
||||
//}
|
|
@ -20,20 +20,20 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
|
||||
public IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
private readonly IRepository<ClinicalData> _clinicalDataRepository;
|
||||
|
||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository;
|
||||
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||
|
||||
public ClinicalDataSetService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<ClinicalData> clinicalDataRepository,
|
||||
|
||||
IRepository<ClinicalDataTrialSet> ClinicalDataTrialSetRepository,
|
||||
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
||||
IRepository<PreviousPDF> previousPDFRepository
|
||||
)
|
||||
{
|
||||
_subjectVisitRepository = subjectVisitRepository;
|
||||
_clinicalDataRepository = clinicalDataRepository;
|
||||
|
||||
_clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
|
||||
_clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
|
||||
this._previousPDFRepository = previousPDFRepository;
|
||||
|
@ -118,10 +118,10 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
foreach (var item in nocheckids)
|
||||
{
|
||||
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(item, x => new ClinicalDataTrialSet()
|
||||
{
|
||||
IsCheck = false
|
||||
});
|
||||
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(item, x => new ClinicalDataTrialSet()
|
||||
{
|
||||
IsCheck = false
|
||||
});
|
||||
}
|
||||
|
||||
await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
||||
|
|
|
@ -7,11 +7,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public class ClinicalDataAddOrEdit : ClinicalData
|
||||
{
|
||||
public new Guid? Id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class ClinicalDataTrialSetAddOrEdit : ClinicalDataSystemSetAddOrEdit
|
||||
{
|
||||
|
@ -30,9 +26,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
|
@ -57,10 +50,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
}
|
||||
|
||||
public class ClinicalDataView : ClinicalData
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class ClinicalDataTrialSetView : ClinicalDataSystemSetView
|
||||
{
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<PageOutput<PreviewTheReadingListOutDto>> GetPreviewTheReadingList(PreviewTheReadingListInDto inDto)
|
||||
{
|
||||
var visitQuery = _subjectVisitRepository.Where(x => x.TrialId == inDto.TrialId && x.InPlan&&x.LatestScanDate!=null)
|
||||
var visitQuery = _subjectVisitRepository.Where(x => x.TrialId == inDto.TrialId &&x.LatestScanDate!=null)
|
||||
.WhereIf(inDto.SiteIds.Count != 0, x => inDto.SiteIds.Contains(x.SiteId));
|
||||
var existsBubjectVisitsQuery= _readModuleRepository.Where(y => y.ReadingSetType == inDto.ReadingSetType && y.TrialId == inDto.TrialId).Select(x => x.SubjectVisitId);
|
||||
visitQuery = visitQuery.Where(x => !existsBubjectVisitsQuery.Contains(x.Id))
|
||||
|
|
|
@ -23,11 +23,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
//.ForMember(d => d.SiteNames, u => u.MapFrom(s => s.ReadingPeriodSites.SelectMany(x => x.Site.SiteName).ToList()));
|
||||
|
||||
|
||||
CreateMap<ClinicalData, ClinicalDataAddOrEdit>().ReverseMap();
|
||||
|
||||
|
||||
|
||||
CreateMap<ClinicalData, ClinicalDataView>();
|
||||
|
||||
|
||||
CreateMap<ClinicalDataTrialSet, ClinicalDataTrialSetAddOrEdit>().ReverseMap();
|
||||
|
|
|
@ -16,15 +16,18 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<TrialQCQuestion> _trialQCQuestionRepository;
|
||||
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
|
||||
public TrialConfigService(IRepository<Trial> trialRepository,
|
||||
IRepository<TrialQCQuestion> trialQCQuestionRepository,
|
||||
IRepository<ClinicalDataTrialSet> clinicalDataTrialSetRepository,
|
||||
IEasyCachingProvider provider
|
||||
)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
this._trialQCQuestionRepository = trialQCQuestionRepository;
|
||||
this._clinicalDataTrialSetRepository = clinicalDataTrialSetRepository;
|
||||
this._provider = provider;
|
||||
}
|
||||
|
||||
|
@ -308,6 +311,8 @@ namespace IRaCIS.Core.Application
|
|||
_mapper.Map(trialConfig, trialInfo);
|
||||
trialInfo.UpdateTime = DateTime.Now;
|
||||
|
||||
//__clinicalDataTrialSetRepository.up
|
||||
|
||||
|
||||
return ResponseOutput.Ok(await _repository.SaveChangesAsync());
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<AssginSiteCRCCommand, TrialSiteUser>();
|
||||
CreateMap<Domain.Models.Trial, TrialConfigDTO>().ForMember(t => t.TrialId, u => u.MapFrom(c => c.Id))
|
||||
.ForMember(t => t.ClinicalDataSetNames, u => u.MapFrom(c => c.clinicalDataTrialSets.Where(v => v.IsCheck).Select(r => r.ClinicalDataSetName)))
|
||||
.ForMember(t => t.ClinicalDataSetNames, u => u.MapFrom(c => c.clinicalDataTrialSets.Where(v => v.IsCheck&&v.IsConfirm).Select(r => r.ClinicalDataSetName)))
|
||||
.ForMember(t => t.CriterionIds, u => u.MapFrom(c => c.TrialDicList.Where(v => v.KeyName == StaticData.Criterion).Select(r => r.DictionaryId)));
|
||||
CreateMap<Domain.Models.Trial, TrialSubjectConfig>();
|
||||
CreateMap<Domain.Models.Trial, TrialSubjectAndSVConfig>();
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
|
||||
|
||||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
///<summary>
|
||||
/// 临床资料
|
||||
///</summary>
|
||||
[Table("ClinicalData")]
|
||||
public class ClinicalData : Entity, IAuditAdd
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 受试者ID
|
||||
/// </summary>
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访视或者阅片ID
|
||||
/// </summary>
|
||||
public Guid? VisitOrReadId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 临床级别
|
||||
/// </summary>
|
||||
public ClinicalLevel? ClinicalLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据类型
|
||||
/// </summary>
|
||||
public ClinicalDataType? DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上传方式
|
||||
/// </summary>
|
||||
public ClinicalUploadType? UploadType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -58,6 +58,11 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public bool IsCheck { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否确认
|
||||
/// </summary>
|
||||
public bool IsConfirm { get; set; }
|
||||
|
||||
|
||||
[ForeignKey("TrialId")]
|
||||
public Trial Trial { get; set; }
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
|
||||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
///<summary>
|
||||
/// 项目的临床数据
|
||||
///</summary>
|
||||
[Table("ReadingClinicalData")]
|
||||
public class ReadingClinicalData : Entity, IAuditAdd
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -186,9 +186,6 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
public virtual DbSet<ClinicalDataTrialSet> ClinicalDataTrialSet { get; set; }
|
||||
|
||||
public virtual DbSet<ClinicalDataSystemSet> ClinicalDataSystemSet { get; set; }
|
||||
|
||||
public virtual DbSet<ClinicalData> ClinicalData { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
Loading…
Reference in New Issue