882 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			C#
		
	
	
			
		
		
	
	
			882 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			C#
		
	
	
using FellowOakDicom;
 | 
						||
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
 | 
						||
using IRaCIS.Core.Domain.Share;
 | 
						||
using Newtonsoft.Json;
 | 
						||
using System.ComponentModel.DataAnnotations;
 | 
						||
 | 
						||
namespace IRaCIS.Core.Application.Contracts
 | 
						||
{
 | 
						||
 | 
						||
    public class UnionStudyBaseModel
 | 
						||
    {
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
        public Guid TrialSiteId { get; set; }
 | 
						||
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
 | 
						||
        public Guid SubjectVisitId { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public string SubjectCode { get; set; } = String.Empty;
 | 
						||
 | 
						||
        public string VisitName { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public decimal VisitNum { get; set; }
 | 
						||
 | 
						||
        public string TrialSiteCode { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string TrialSiteAliasName { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string Uploader { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public DateTime UploadTime { get; set; }
 | 
						||
 | 
						||
        public string StudyCode { get; set; }
 | 
						||
 | 
						||
 | 
						||
        //[JsonIgnore]
 | 
						||
        //public string DicomStudyCode { get; set; } = string.Empty;
 | 
						||
        //[JsonIgnore]
 | 
						||
        //public int NoneDicomCode { get; set; }
 | 
						||
 | 
						||
        public string RecordPath { get; set; } = string.Empty;
 | 
						||
        public bool IsDicom { get; set; }
 | 
						||
 | 
						||
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class UnionStudyMonitorModel : UnionStudyBaseModel
 | 
						||
    {
 | 
						||
        public Guid StudyId { get; set; }
 | 
						||
 | 
						||
 | 
						||
 | 
						||
 | 
						||
 | 
						||
        public string UploadStartTimeStr => UploadStartTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
 | 
						||
        public string UploadFinishedTimeStr => UploadFinishedTime?.ToString("yyyy-MM-dd HH:mm:ss.fff");
 | 
						||
 | 
						||
        public string ArchiveFinishedTimeStr => ArchiveFinishedTime?.ToString("yyyy-MM-dd HH:mm:ss.fff");
 | 
						||
 | 
						||
 | 
						||
        public string UploadIntervalStr
 | 
						||
        {
 | 
						||
            get
 | 
						||
            {
 | 
						||
                var uploadTimeSpan = UploadFinishedTime - UploadStartTime;
 | 
						||
 | 
						||
                return $" {uploadTimeSpan?.Hours}:{uploadTimeSpan?.Minutes}:{uploadTimeSpan?.Seconds}.{uploadTimeSpan?.Milliseconds}";
 | 
						||
            }
 | 
						||
        }
 | 
						||
 | 
						||
        public string ArchiveIntervalStr
 | 
						||
        {
 | 
						||
            get
 | 
						||
            {
 | 
						||
                var uploadTimeSpan = ArchiveFinishedTime - UploadFinishedTime;
 | 
						||
 | 
						||
                return $" {uploadTimeSpan?.Hours}:{uploadTimeSpan?.Minutes}:{uploadTimeSpan?.Seconds}.{uploadTimeSpan?.Milliseconds}";
 | 
						||
            }
 | 
						||
        }
 | 
						||
 | 
						||
 | 
						||
 | 
						||
        public string TimeInterval
 | 
						||
        {
 | 
						||
            get
 | 
						||
            {
 | 
						||
 | 
						||
                var uploadTimeSpan = ArchiveFinishedTime - UploadStartTime;
 | 
						||
 | 
						||
                return $" {uploadTimeSpan?.Hours}:{uploadTimeSpan?.Minutes}:{uploadTimeSpan?.Seconds}.{uploadTimeSpan?.Milliseconds}";
 | 
						||
 | 
						||
            }
 | 
						||
        }
 | 
						||
 | 
						||
        public DateTime UploadStartTime { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public DateTime? UploadFinishedTime { get; set; }
 | 
						||
 | 
						||
        public DateTime? ArchiveFinishedTime { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public decimal FileSize { get; set; }
 | 
						||
 | 
						||
        public string IP { get; set; } = String.Empty;
 | 
						||
 | 
						||
 | 
						||
        public bool IsDicomReUpload { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public int FileCount { get; set; }
 | 
						||
 | 
						||
        public bool IsSuccess { get; set; }
 | 
						||
 | 
						||
        public string Note = string.Empty;
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
    public class UnionStudyViewModel : UnionStudyBaseModel
 | 
						||
    {
 | 
						||
 | 
						||
        public Guid Id { get; set; }
 | 
						||
 | 
						||
        public bool IsFromPACS { get; set; }
 | 
						||
 | 
						||
        public int? Count { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public string Modalities { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string Bodypart { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public DateTime? StudyTime { get; set; }
 | 
						||
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
 | 
						||
    public class StudyQuery : PageInput
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
        public Guid? SubjectId { get; set; }
 | 
						||
 | 
						||
        public Guid? TrialSiteId { get; set; }
 | 
						||
        public Guid? SubjectVisitId { get; set; }
 | 
						||
 | 
						||
        public string SubjectInfo { get; set; } = String.Empty;
 | 
						||
 | 
						||
 | 
						||
        public string[]? VisitPlanArray { get; set; }
 | 
						||
 | 
						||
        public Guid? VisitTaskId { get; set; }
 | 
						||
 | 
						||
        public bool? IsDicom { get; set; }
 | 
						||
 | 
						||
        public string? Uploader { get; set; }
 | 
						||
 | 
						||
        public bool? IsSuccess { get; set; }
 | 
						||
 | 
						||
        public string? StudyCode { get; set; }
 | 
						||
 | 
						||
        public bool? IsFromPACS { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public DateTime? UploadStartTime { get; set; }
 | 
						||
 | 
						||
        public DateTime? UploadFinishedTime { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
    public class PriArchiveTaskStudyCommand
 | 
						||
    {
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectVisitId { get; set; }
 | 
						||
 | 
						||
        public int FileCount { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class PreArchiveDicomStudyCommand
 | 
						||
    {
 | 
						||
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialSiteId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectVisitId { get; set; }
 | 
						||
 | 
						||
        public bool IsDicomReUpload { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public int FileCount { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
    public class SubejctZipInfoQuery
 | 
						||
    {
 | 
						||
        public Guid? SubejctId { get; set; }
 | 
						||
 | 
						||
        public string? SubjectCode { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public Guid? SubejectVisitId { get; set; }
 | 
						||
 | 
						||
        public Guid? TrialReadingCriterionId { get; set; }
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class TaskStudyAchivePreConfirmCommand
 | 
						||
    {
 | 
						||
        public List<string> StudyInstanceUidList { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public string SubjectCode { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
        public Guid? VisitTaskId { get; set; }
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class TaskStudyArchiveConfirmResult
 | 
						||
    {
 | 
						||
        public string StudyInstanceUid { get; set; }
 | 
						||
 | 
						||
        public bool IsAllowUpload { get; set; }
 | 
						||
 | 
						||
        public bool IsAllowReUpload { get; set; }
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class TaskArchiveStudyCommand
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid StudyMonitorId { get; set; }
 | 
						||
 | 
						||
        public int FailedFileCount { get; set; }
 | 
						||
 | 
						||
        public string RecordPath { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public AddOrUpdateStudyDto Study { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid VisitTaskId { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class NewArchiveStudyCommand
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialSiteId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectVisitId { get; set; }
 | 
						||
        [NotDefault]
 | 
						||
        public Guid StudyMonitorId { get; set; }
 | 
						||
 | 
						||
        public int FailedFileCount { get; set; }
 | 
						||
 | 
						||
        public string RecordPath { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public AddOrUpdateStudyDto Study { get; set; }
 | 
						||
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class AddOrUpdateStudyDto
 | 
						||
    {
 | 
						||
 | 
						||
 | 
						||
        public string StudyId { get; set; } = string.Empty;
 | 
						||
 | 
						||
        //public int Code { get; set; } = 0;
 | 
						||
 | 
						||
        //public string StudyCode { get; set; } = string.Empty;
 | 
						||
 | 
						||
 | 
						||
        public string StudyInstanceUid { get; set; } = string.Empty;
 | 
						||
        public DateTime? StudyTime { get; set; }
 | 
						||
        public string Modalities { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string Description { get; set; } = string.Empty;
 | 
						||
        public int SeriesCount { get; set; } = 0;
 | 
						||
        public int InstanceCount { get; set; } = 0;
 | 
						||
 | 
						||
        public string InstitutionName { get; set; } = string.Empty;
 | 
						||
        public string PatientId { 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 AccessionNumber { get; set; } = string.Empty;
 | 
						||
        public string PatientBirthDate { get; set; } = string.Empty;
 | 
						||
        public string AcquisitionTime { get; set; } = string.Empty;
 | 
						||
        public string AcquisitionNumber { get; set; } = string.Empty;
 | 
						||
        public string TriggerTime { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string BodyPartExamined { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string DicomStudyDate { get; set; }
 | 
						||
 | 
						||
        public string DicomStudyTime { get; set; }
 | 
						||
 | 
						||
        public List<AddOrUpdateSeriesDto> SeriesList { get; set; }
 | 
						||
 | 
						||
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class AddOrUpdateSeriesDto
 | 
						||
    {
 | 
						||
        public string StudyInstanceUid { get; set; }
 | 
						||
        public string SeriesInstanceUid { get; set; }
 | 
						||
        public int SeriesNumber { get; set; }
 | 
						||
        public DateTime? SeriesTime { get; set; }
 | 
						||
        public string Modality { get; set; } = string.Empty;
 | 
						||
        public string Description { get; set; } = string.Empty;
 | 
						||
        public int InstanceCount { get; set; }
 | 
						||
        public string SliceThickness { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string ImagePositionPatient { get; set; } = string.Empty;
 | 
						||
        public string ImageOrientationPatient { get; set; } = string.Empty;
 | 
						||
        public string BodyPartExamined { get; set; } = string.Empty;
 | 
						||
        public string SequenceName { get; set; } = string.Empty;
 | 
						||
        public string ProtocolName { get; set; } = string.Empty;
 | 
						||
        public string ImagerPixelSpacing { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string AcquisitionTime { get; set; } = string.Empty;
 | 
						||
        public string AcquisitionNumber { get; set; } = string.Empty;
 | 
						||
        public string TriggerTime { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string ImageResizePath { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string DicomSeriesDate { get; set; }
 | 
						||
 | 
						||
        public string DicomSeriesTime { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public List<AddInstanceDto> InstanceList { get; set; }
 | 
						||
 | 
						||
        public Guid? VisitTaskId { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
    public class AddInstanceDto
 | 
						||
    {
 | 
						||
        public string StudyInstanceUid { get; set; }
 | 
						||
        public string SeriesInstanceUid { get; set; }
 | 
						||
        public string SopInstanceUid { get; set; }
 | 
						||
        public int InstanceNumber { get; set; }
 | 
						||
        public DateTime? InstanceTime { get; set; }
 | 
						||
        public bool CPIStatus { get; set; }
 | 
						||
        public int ImageRows { get; set; }
 | 
						||
        public int ImageColumns { get; set; }
 | 
						||
        public int SliceLocation { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public string SliceThickness { get; set; } = string.Empty;
 | 
						||
        public int NumberOfFrames { get; set; }
 | 
						||
        public string PixelSpacing { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string ImagerPixelSpacing { get; set; } = string.Empty;
 | 
						||
        public string FrameOfReferenceUID { get; set; } = string.Empty;
 | 
						||
        public string WindowCenter { get; set; } = string.Empty;
 | 
						||
        public string WindowWidth { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public bool Anonymize { get; set; }
 | 
						||
        public string Path { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public string HtmlPath { get; set; } = string.Empty;
 | 
						||
 | 
						||
        public long FileSize { get; set; }
 | 
						||
 | 
						||
        public string SOPClassUID { get; set; }
 | 
						||
 | 
						||
        public string MediaStorageSOPClassUID { get; set; }
 | 
						||
 | 
						||
        public string TransferSytaxUID { get; set; }
 | 
						||
 | 
						||
        public string MediaStorageSOPInstanceUID { get; set; }
 | 
						||
 | 
						||
        public bool IsEncapsulated => DicomTransferSyntax.Lookup(DicomUID.Parse(TransferSytaxUID)).IsEncapsulated;
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class CRCUploadTaskQuery
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialReadingCriterionId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public string SubjectCode { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class CRCUploadTaskStudyQuery : SortInput
 | 
						||
    {
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid VisitTaskId { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
    public class IRUploadStudyQuery : SortInput
 | 
						||
    {
 | 
						||
        public Guid? SubjectId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialReadingCriterionId { get; set; }
 | 
						||
 | 
						||
        public string? SubjectCode { get; set; }
 | 
						||
 | 
						||
        public Guid? VisitTaskId { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class IRTaskUploadedDicomStudyQuery
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid VisitTaskId { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class IRUploadTaskDicomStudyDto : DicomStudyBasicInfo
 | 
						||
    {
 | 
						||
 | 
						||
        public int UploadedSeriesCount { get; set; }
 | 
						||
 | 
						||
        public int UploadedInstanceCount { get; set; }
 | 
						||
 | 
						||
        public List<string> UploadedSopInstanceUidList { get; set; }
 | 
						||
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class IRUploadTaskNoneDicomStudyDto : NoneDicomStudyBasicInfo
 | 
						||
    {
 | 
						||
 | 
						||
        public int UploadedFileCount { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class TaskDicomStudyDTO : DicomStudyBasicInfo
 | 
						||
    {
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
 | 
						||
        public string SubjectCode { get; set; }
 | 
						||
 | 
						||
        public string TaskBlindName { get; set; }
 | 
						||
 | 
						||
        public string TaskName { get; set; }
 | 
						||
        public Guid? SourceSubjectVisitId { get; set; }
 | 
						||
 | 
						||
 | 
						||
 | 
						||
 | 
						||
        public int UploadedSeriesCount { get; set; }
 | 
						||
 | 
						||
        public int UploadedInstanceCount { get; set; }
 | 
						||
 | 
						||
        public List<string> UploadedSopInstanceUidList { get; set; }
 | 
						||
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class NoneDicomFileInfo
 | 
						||
    {
 | 
						||
        [JsonIgnore]
 | 
						||
        public Guid? OriginNoneDicomStudyId { get; set; }
 | 
						||
 | 
						||
        public string FileType { get; set; }
 | 
						||
 | 
						||
        public long? FileSize { get; set; }
 | 
						||
        public string FileName { get; set; }
 | 
						||
 | 
						||
        public string Path { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class TaskNoneDicomStudyDTO : NoneDicomStudyBasicInfo
 | 
						||
    {
 | 
						||
        public Guid VisitTaskId { get; set; }
 | 
						||
 | 
						||
        public int UploadedFileCount { get; set; }
 | 
						||
 | 
						||
        public List<NoneDicomFileInfo> UploadedFileList { get; set; }
 | 
						||
 | 
						||
        public List<NoneDicomFileInfo> FileList { get; set; }
 | 
						||
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
 | 
						||
        public string SubjectCode { get; set; }
 | 
						||
 | 
						||
        public string TaskBlindName { get; set; }
 | 
						||
 | 
						||
        public string TaskName { get; set; }
 | 
						||
        public Guid? SourceSubjectVisitId { get; set; }
 | 
						||
 | 
						||
        public ReadingTaskState ReadingTaskState { get; set; }
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    #region 下载重新生成名字
 | 
						||
    public class ImageDownloadDto
 | 
						||
    {
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
        public string SubjectCode { get; set; }
 | 
						||
        public string TrialSiteCode { get; set; }
 | 
						||
        public string VisitName { get; set; }
 | 
						||
 | 
						||
        public string TaskBlindName { get; set; }
 | 
						||
 | 
						||
        
 | 
						||
        public Guid VisitId { get; set; }
 | 
						||
 | 
						||
        public List<DownloadDicomStudyDto> StudyList { get; set; }
 | 
						||
        public List<DownloadNoneDicomStudyDto> NoneDicomStudyList { get; set; } 
 | 
						||
    }
 | 
						||
 | 
						||
    public class DownloadDicomStudyDto
 | 
						||
    {
 | 
						||
        public string PatientId { get; set; }
 | 
						||
        public DateTime? StudyTime { get; set; }
 | 
						||
        public string StudyCode { get; set; }
 | 
						||
        public string StudyInstanceUid { get; set; }
 | 
						||
        public string StudyDIRPath { get; set; }
 | 
						||
 | 
						||
        public List<DownloadDicomSeriesDto> SeriesList { get; set; } 
 | 
						||
    }
 | 
						||
 | 
						||
    public class DownloadDicomSeriesDto
 | 
						||
    {
 | 
						||
        public string Modality { get; set; }
 | 
						||
 | 
						||
        public List<DownloadDicomInstanceDto> InstanceList { get; set; } 
 | 
						||
    }
 | 
						||
 | 
						||
    public class DownloadDicomInstanceDto
 | 
						||
    {
 | 
						||
        public bool IsEncapsulated { get; set; }
 | 
						||
        public Guid InstanceId { get; set; }
 | 
						||
        public string FileName { get; set; }
 | 
						||
        public string Path { get; set; }
 | 
						||
        public long? FileSize { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class DownloadNoneDicomStudyDto
 | 
						||
    {
 | 
						||
        public string Modality { get; set; }
 | 
						||
        public string StudyCode { get; set; }
 | 
						||
        public DateTime? ImageDate { get; set; }
 | 
						||
 | 
						||
        public List<DownloadNoneDicomFileDto> FileList { get; set; } = new();
 | 
						||
    }
 | 
						||
 | 
						||
    public class DownloadNoneDicomFileDto
 | 
						||
    {
 | 
						||
        public string FileName { get; set; }
 | 
						||
        public string Path { get; set; }
 | 
						||
        public string FileType { get; set; }
 | 
						||
        public long? FileSize { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    #endregion
 | 
						||
 | 
						||
    public class CRCUploadedStudyQuqry
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectVisitId { get; set; }
 | 
						||
 | 
						||
        public List<Guid> DicomStudyIdList { get; set; }
 | 
						||
 | 
						||
        public List<Guid> NoneDicomStudyIdList { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class IRReadingDownloadQuery : SortInput
 | 
						||
    {
 | 
						||
        public Guid? SubjectId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialReadingCriterionId { get; set; }
 | 
						||
 | 
						||
        public string? SubjectCode { get; set; }
 | 
						||
 | 
						||
        public Guid? VisitTaskId { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
    public class IRDownloadQuery
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid SubjectId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialReadingCriterionId { get; set; }
 | 
						||
 | 
						||
        [NotDefault]
 | 
						||
        public string SubjectCode { get; set; }
 | 
						||
 | 
						||
        public List<SubjectVisitTaskInfo> SubjectVisitTaskList { get; set; }
 | 
						||
 | 
						||
        public List<Guid> DicomStudyIdList { get; set; }
 | 
						||
 | 
						||
        public List<Guid> NoneDicomStudyIdList { get; set; }
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class TrialKeyImageExportDTO
 | 
						||
    {
 | 
						||
        public Guid Id { get; set; }
 | 
						||
        public string ResearchProgramNo { get; set; }
 | 
						||
        public string CriterionName { get; set; }
 | 
						||
        public ArbitrationRule ArbitrationRule { get; set; }
 | 
						||
 | 
						||
        public bool IsGlobalReading { get; set; }
 | 
						||
 | 
						||
        public List<decimal> SubjectCriterionReadingPeriodVisitNumList { get; set; }
 | 
						||
 | 
						||
        public string TrialSiteCode { get; set; }
 | 
						||
 | 
						||
        public string VisitName { get; set; }
 | 
						||
 | 
						||
        public Decimal VisitTaskNum { get; set; }
 | 
						||
 | 
						||
        public string SubjectCode { get; set; }
 | 
						||
 | 
						||
        public Arm ArmEnum { get; set; }
 | 
						||
 | 
						||
        public Guid? JudgeResultTaskId { get; set; }
 | 
						||
 | 
						||
        public bool? IsTrigerJudge { get; set; }
 | 
						||
        public bool? IsJudgeSelect { get; set; }
 | 
						||
 | 
						||
        public ReadingCategory ReadingCategory { get; set; }
 | 
						||
 | 
						||
        public List<TrialKeyPicturePath> ReadingNoneDicomMarkPathList { get; set; }
 | 
						||
        public List<TrialKeyPicturePath> QuestionMarkPictureList { get; set; }
 | 
						||
 | 
						||
        public List<TrialKeyPicturePath> TableQuestionRowPictureList { get; set; }
 | 
						||
    }
 | 
						||
    public class TrialKeyPicturePath
 | 
						||
    {
 | 
						||
        public string PicturePath { get; set; }
 | 
						||
 | 
						||
        public string OtherPicturePath { get; set; }
 | 
						||
    }
 | 
						||
    public class TrialExportImageCommand
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
        public List<Guid> SubjectVisitIdList { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public bool IsKeyImage { get; set; }
 | 
						||
 | 
						||
        // true 导出阅片,null 就是所有影像
 | 
						||
        public bool? IsExportReading { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
    public class TrialVisitImageQuery : PageInput
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public Guid? TrialSiteId { get; set; }
 | 
						||
 | 
						||
        public string? SubjectCode { get; set; }
 | 
						||
 | 
						||
        public DateTime? BeginScanDate { get; set; }
 | 
						||
        public DateTime? EndScanDate { get; set; }
 | 
						||
    }
 | 
						||
    public class TrialVisitImageStatView
 | 
						||
    {
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
        public Guid SubjectVisitId { get; set; }
 | 
						||
 | 
						||
        public Guid TrialSiteId { get; set; }
 | 
						||
 | 
						||
        public string TrialSiteCode { get; set; }
 | 
						||
 | 
						||
        public string SubjectCode { get; set; }
 | 
						||
 | 
						||
        public string VisitName { get; set; }
 | 
						||
 | 
						||
        public decimal VisitNum { get; set; }
 | 
						||
 | 
						||
        public DateTime? EarliestScanDate { get; set; }
 | 
						||
        public DateTime? LatestScanDate { get; set; }
 | 
						||
 | 
						||
 | 
						||
 | 
						||
        public int TotalStudyCount { get; set; }
 | 
						||
 | 
						||
        public int TotalImageCount { get; set; }
 | 
						||
 | 
						||
        public long? TotalImageSize { get; set; }
 | 
						||
 | 
						||
        public long? TotalReadingImageSize { get; set; }
 | 
						||
 | 
						||
        public string TotalImageSizeStr => TotalImageSize.HasValue
 | 
						||
        ? $"{TotalImageSize.Value / 1024d / 1024d:F3} MB"
 | 
						||
        : "0.000 MB";
 | 
						||
 | 
						||
        public string TotalReadingImageSizeStr => TotalReadingImageSize.HasValue
 | 
						||
       ? $"{TotalReadingImageSize.Value / 1024d / 1024d:F3} MB"
 | 
						||
       : "0.000 MB";
 | 
						||
 | 
						||
        public string ImageTypeStr => $"{(IsHaveDicom ? "DICOM" : "")}{(IsHaveNoneDicom&&IsHaveDicom?" , ":"")}{(IsHaveNoneDicom ? "Non-DICOM" : "")}";
 | 
						||
 | 
						||
        public bool IsHaveDicom { get; set; }
 | 
						||
 | 
						||
        public bool IsHaveNoneDicom { get; set; }
 | 
						||
 | 
						||
        #region 废弃,为了字段排序
 | 
						||
        //public int TotalStudyCount => DicomStudyCount + NoneDicomStudyCount;
 | 
						||
 | 
						||
        //public int TotalImageCount => DicomImageCount + NoneDicomImageCount;
 | 
						||
 | 
						||
        //public long? TotalImageSize => DicomImageSize + NoneDicomImageSize;
 | 
						||
 | 
						||
        //public int DicomStudyCount { get; set; }
 | 
						||
        //public int DicomImageCount { get; set; }
 | 
						||
        //public long? DicomImageSize { get; set; }
 | 
						||
 | 
						||
 | 
						||
        //public int NoneDicomStudyCount { get; set; }
 | 
						||
        //public int NoneDicomImageCount { get; set; }
 | 
						||
        //public long? NoneDicomImageSize { get; set; }
 | 
						||
 | 
						||
        #endregion
 | 
						||
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
 | 
						||
    public class TrialImageStatInfo
 | 
						||
    {
 | 
						||
        public int SubjectCount { get; set; }
 | 
						||
 | 
						||
        public int SubjectVisitCount { get; set; }
 | 
						||
 | 
						||
        public long? TotalImageSize { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public string TotalImageSizeStr => TotalImageSize.HasValue
 | 
						||
            ? $"{TotalImageSize.Value / 1024d / 1024d:F3} MB"
 | 
						||
            : "0.000 MB";
 | 
						||
 | 
						||
 | 
						||
        public string SubjectImageAVGSizeStr => TotalImageSize.HasValue
 | 
						||
        ? $"{TotalImageSize.Value / SubjectCount / 1024d / 1024d:F3} MB"
 | 
						||
        : "0.000 MB";
 | 
						||
 | 
						||
 | 
						||
        public string SubjectVisitImageAVGSizeStr => TotalImageSize.HasValue
 | 
						||
        ? $"{TotalImageSize.Value / SubjectVisitCount / 1024d / 1024d:F3} MB"
 | 
						||
        : "0.000 MB";
 | 
						||
 | 
						||
        public long? TotalReadingImageSize { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public string TotalReadingImageSizeStr => TotalReadingImageSize.HasValue
 | 
						||
          ? $"{TotalReadingImageSize.Value / 1024d / 1024d:F3} MB"
 | 
						||
          : "0.000 MB";
 | 
						||
 | 
						||
 | 
						||
        public string SubjectReadingImageAVGSizeStr => TotalReadingImageSize.HasValue
 | 
						||
        ? $"{TotalReadingImageSize.Value / SubjectCount / 1024d / 1024d:F3} MB"
 | 
						||
        : "0.000 MB";
 | 
						||
 | 
						||
 | 
						||
        public string SubjectVisitReadingImageAVGSizeStr => TotalReadingImageSize.HasValue
 | 
						||
        ? $"{TotalReadingImageSize.Value / SubjectVisitCount / 1024d / 1024d:F3} MB"
 | 
						||
        : "0.000 MB";
 | 
						||
 | 
						||
    }
 | 
						||
    public class TrialImageDownloadView
 | 
						||
    {
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
        public string TrialSiteCode { 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; }
 | 
						||
 | 
						||
        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; }
 | 
						||
 | 
						||
        public UserTypeEnum UserTypeEnum { get; set; }
 | 
						||
 | 
						||
 | 
						||
        public string UploadIntervalStr
 | 
						||
        {
 | 
						||
            get
 | 
						||
            {
 | 
						||
                var uploadTimeSpan = DownloadEndTime - DownloadStartTime;
 | 
						||
 | 
						||
                return $" {uploadTimeSpan?.Hours}:{uploadTimeSpan?.Minutes}:{uploadTimeSpan?.Seconds}.{uploadTimeSpan?.Milliseconds}";
 | 
						||
            }
 | 
						||
        }
 | 
						||
 | 
						||
    }
 | 
						||
 | 
						||
    public class TrialIamgeDownQuery : PageInput
 | 
						||
    {
 | 
						||
        [NotDefault]
 | 
						||
        public Guid TrialId { get; set; }
 | 
						||
 | 
						||
        public string? SubjectCode { get; set; }
 | 
						||
 | 
						||
        public ImageType? ImageType { get; set; }
 | 
						||
 | 
						||
        public UserTypeEnum? UserType { get; set; }
 | 
						||
 | 
						||
        public bool? IsSuccess { get; set; }
 | 
						||
 | 
						||
        public DateTime? DownloadStartTime { get; set; }
 | 
						||
        public DateTime? DownloadEndTime { get; set; }
 | 
						||
 | 
						||
        public string? IP { get; set; }
 | 
						||
 | 
						||
        public string? Name { get; set; }
 | 
						||
    }
 | 
						||
 | 
						||
    public class SubjectVisitTaskInfo
 | 
						||
    {
 | 
						||
        public Guid SubjectVisitId { get; set; }
 | 
						||
 | 
						||
        public Guid TaskId { get; set; }
 | 
						||
    }
 | 
						||
}
 |