1、阅片跟踪表
continuous-integration/drone/push Build is passing Details

2、接收记录表
3、接收影像检查表
4、下载记录表
IRC_NewDev
hang 2024-10-08 11:38:37 +08:00
parent 5bce1cafa3
commit 658f9c7c40
7 changed files with 307 additions and 4 deletions

View File

@ -712,6 +712,30 @@
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialDownloadList_Export(IRaCIS.Core.Application.Contracts.TrialIamgeDownQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialImageDownload},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
影像下载记录表
</summary>
<param name="inQuery"></param>
<param name="_trialImageDownloadRepository"></param>
<param name="_dictionaryService"></param>
<param name="_trialRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetSCPImageUploadList_Export(IRaCIS.Application.Contracts.SCPImageUploadQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SCPImageUpload},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
影像接收记录表
</summary>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetPatientList_Export(IRaCIS.Application.Contracts.PatientTrialQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SCPPatient},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
影像检查列表-患者为维度组织
</summary>
<param name="inQuery"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetSelfAnalysisTaskList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
<summary>
自身一致性分析(仅做了resist1.1)

View File

@ -1204,6 +1204,145 @@ namespace IRaCIS.Core.Application.Service.Common
}
/// <summary>
/// 影像下载记录表
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_trialImageDownloadRepository"></param>
/// <param name="_dictionaryService"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> GetTrialDownloadList_Export(TrialIamgeDownQuery inQuery,
[FromServices] IRepository<TrialImageDownload> _trialImageDownloadRepository,
[FromServices] IDictionaryService _dictionaryService,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialImageDownloadRepository.Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.SubjectCode.Contains(inQuery.SubjectCode))
.WhereIf(inQuery.IP.IsNotNullOrEmpty(), t => t.IP.Contains(inQuery.IP))
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.CreateUser.UserName.Contains(inQuery.Name) || t.CreateUser.FullName.Contains(inQuery.Name))
.WhereIf(inQuery.ImageType != null, t => t.ImageType == inQuery.ImageType)
.WhereIf(inQuery.UserType != null, t => t.CreateUser.UserTypeEnum == inQuery.UserType)
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
.WhereIf(inQuery.DownloadStartTime != null, t => t.DownloadStartTime >= inQuery.DownloadStartTime)
.WhereIf(inQuery.DownloadEndTime != null, t => t.DownloadEndTime <= inQuery.DownloadEndTime)
.ProjectTo<TrialImageDownloadExportDto>(_mapper.ConfigurationProvider);
var list = query.SortToListAsync(inQuery);
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialImageDownloadList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialImageDownloadExportDto));
}
/// <summary>
/// 影像接收记录表
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> GetSCPImageUploadList_Export(SCPImageUploadQuery inQuery,
[FromServices] IRepository<SCPImageUpload> _scpImageUploadRepository,
[FromServices] IDictionaryService _dictionaryService,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _scpImageUploadRepository.Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CalledAE), t => t.CalledAE.Contains(inQuery.CalledAE))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAEIP), t => t.CallingAEIP.Contains(inQuery.CallingAEIP))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.CallingAE.Contains(inQuery.CallingAE))
.WhereIf(inQuery.StartTime != null, t => t.StartTime >= inQuery.StartTime)
.WhereIf(inQuery.EndTime != null, t => t.EndTime <= inQuery.EndTime)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteKeyInfo), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteKeyInfo)
|| t.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteKeyInfo) || t.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteKeyInfo))
.ProjectTo<SCPImageUploadExportDTO>(_mapper.ConfigurationProvider);
var list = query.SortToListAsync(inQuery);
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSCPImageUploadList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SCPImageUploadExportDTO));
}
/// <summary>
///影像检查列表-患者为维度组织
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> GetPatientList_Export(PatientTrialQuery inQuery,
[FromServices] IRepository<SCPPatient> _patientRepository,
[FromServices] IDictionaryService _dictionaryService,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _patientRepository.Where(t => t.TrialId == inQuery.TrialId)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientName), t => t.PatientName.Contains(inQuery.PatientName))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubejctCode), t => t.Subject.Code.Contains(inQuery.SubejctCode))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteKeyInfo), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteKeyInfo)
|| t.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteKeyInfo) || t.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteKeyInfo))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.SCPStudyList.Any(t => t.CallingAE == inQuery.CallingAE))
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CalledAE), t => t.SCPStudyList.Any(t => t.CalledAE == inQuery.CalledAE))
.WhereIf(inQuery.BeginPushTime != null, t => t.LatestPushTime >= inQuery.BeginPushTime)
.WhereIf(inQuery.EndPushTime != null, t => t.LatestPushTime <= inQuery.EndPushTime);
var resultQuery = from patient in query
select new SCPPatientSubjectExportDTO()
{
//CreateUserId = patient.CreateUserId,
//UpdateTime = patient.UpdateTime,
//UpdateUserId = patient.UpdateUserId,
//TrialId = patient.TrialId,
//SubejctId = patient.SubjectId,
//CreateTime = patient.CreateTime,
//PatientId = patient.Id,
PatientBirthDate = patient.PatientBirthDate,
CalledAEList = patient.SCPStudyList.Select(t => t.CalledAE).Distinct().ToList(),
CallingAEList = patient.SCPStudyList.Select(t => t.CallingAE).Distinct().ToList(),
EarliestStudyTime = patient.EarliestStudyTime,
LatestStudyTime = patient.LatestStudyTime,
LatestPushTime = patient.LatestPushTime,
PatientAge = patient.PatientAge,
PatientName = patient.PatientName,
PatientIdStr = patient.PatientIdStr,
PatientSex = patient.PatientSex,
StudyCount = patient.SCPStudyList.Count(),
SubjectCode = patient.Subject.Code,
TrialSiteAliasName = patient.TrialSite.TrialSiteAliasName,
TrialSiteCode = patient.TrialSite.TrialSiteCode,
TrialSiteName = patient.TrialSite.TrialSiteName
};
var list = query.SortToListAsync(inQuery);
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSCPImageUploadPatientList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SCPPatientSubjectExportDTO));
}
/// <summary>
/// 自身一致性分析(仅做了resist1.1)

View File

@ -82,6 +82,13 @@ namespace IRaCIS.Core.Application.Service
CreateMap<ExploreRecommend, ExploreRecommendView>();
CreateMap<ExploreRecommend, ExploreRecommendAddOrEdit>().ReverseMap();
CreateMap<TrialImageDownload, TrialImageDownloadExportDto>()
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUser.FullName))
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUser.UserTypeEnum))
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName));
}
}

View File

@ -871,6 +871,95 @@ namespace IRaCIS.Core.Application.Contracts
public bool IsInvalid { get; set; }
}
public class TrialImageDownloadExportDto
{
public Guid TrialId { get; set; }
public string SubjectCode { get; set; }
public bool IsSuccess { get; set; }
public DateTime DownloadStartTime { get; set; }
public DateTime? DownloadEndTime { get; set; }
public string VisitName { get; set; }
[DictionaryTranslateAttribute("downloadImageType")]
public ImageType ImageType { get; set; }
public int NoneDicomStudyCount { get; set; }
public int DicomStudyCount { get; set; }
public int ImageCount { get; set; }
public long ImageSize { get; set; }
public string UserName { get; set; }
public string UserFullName { get; set; }
public DateTime CreateTime { get; set; }
public string IP { get; set; }
[DictionaryTranslateAttribute("UserType")]
public UserTypeEnum UserTypeEnum { get; set; }
public string ImageSizeStr => (ImageSize / Math.Pow(1024, 2)).ToString("F3") + 'M';
public string UploadIntervalStr
{
get
{
var uploadTimeSpan = DownloadEndTime - DownloadStartTime;
return $" {uploadTimeSpan?.Hours}:{uploadTimeSpan?.Minutes}:{uploadTimeSpan?.Seconds}.{uploadTimeSpan?.Milliseconds}";
}
}
}
public class SCPImageUploadExportDTO
{
public string CallingAE { get; set; } = string.Empty;
public string CalledAE { get; set; } = string.Empty;
public string CallingAEIP { get; set; } = string.Empty;
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public int FileCount { get; set; }
public long FileSize { get; set; }
public int StudyCount { get; set; }
public Guid TrialId { get; set; }
public Guid TrialSiteId { get; set; }
public string TrialSiteCode { get; set; }
public string TrialSiteName { get; set; }
public string TrialSiteAliasName { get; set; }
public string UploadIntervalStr
{
get
{
var uploadTimeSpan = EndTime - StartTime;
return $" {uploadTimeSpan.Hours}:{uploadTimeSpan.Minutes}:{uploadTimeSpan.Seconds}.{uploadTimeSpan.Milliseconds}";
}
}
public string ImageSizeStr => (FileSize / Math.Pow(1024, 2)).ToString("F3") + 'M';
}
public class AnalysisExortCommon
{

View File

@ -256,9 +256,45 @@ namespace IRaCIS.Application.Contracts
public string? TrialSiteName { get; set; }
public string? TrialSiteAliasName { get; set; }
}
public class SCPPatientSubjectExportDTO
{
public int? StudyCount { get; set; }
public string? SubjectCode { get; set; }
public string? TrialSiteCode { get; set; }
public string? TrialSiteName { get; set; }
public string? TrialSiteAliasName { get; set; }
public string PatientIdStr { get; set; } = string.Empty;
public string PatientName { get; set; } = string.Empty;
public string PatientAge { get; set; } = string.Empty;
public string PatientSex { get; set; } = string.Empty;
public string PatientBirthDate { get; set; } = string.Empty;
public DateTime? EarliestStudyTime { get; set; }
public DateTime? LatestStudyTime { get; set; }
public DateTime LatestPushTime { get; set; }
public List<string> CallingAEList { get; set; } = new List<string>();
public List<string> CalledAEList { get; set; } = new List<string>();
public string CallingAEListStr => string.Join(",", CallingAEList);
public string CalledAEListStr => string.Join(",", CalledAEList);
}
public class PatientQuery : PageInput
{

View File

@ -113,8 +113,12 @@ namespace IRaCIS.Core.Application.Service
CreateMap<SCPImageUpload, SCPImageUploadView>()
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
.ForMember(d => d.TrialSiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName))
;
.ForMember(d => d.TrialSiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName));
CreateMap<SCPImageUpload, SCPImageUploadExportDTO>()
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
.ForMember(d => d.TrialSiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName));
CreateMap<SCPStudy, DicomStudy>();

View File

@ -252,7 +252,11 @@ public static class StaticData
public const string TrialMedicalReviewList_Export = "TrialMedicalReviewList_Export";
public static string TrialImageDownloadList_Export = "TrialImageDownloadList_Export";
public static string TrialSCPImageUploadList_Export = "TrialSCPImageUploadList_Export";
public static string TrialSCPImageUploadPatientList_Export = "TrialSCPImageUploadPatientList_Export";
//public const string TrialRECIST1Point1SelfAnalysisList_Export = "TrialRECIST1Point1SelfAnalysisList_Export";