328 lines
		
	
	
		
			9.5 KiB
		
	
	
	
		
			C#
		
	
	
			
		
		
	
	
			328 lines
		
	
	
		
			9.5 KiB
		
	
	
	
		
			C#
		
	
	
using Newtonsoft.Json;
 | 
						|
using System;
 | 
						|
using System.Collections.Generic;
 | 
						|
using System.ComponentModel.DataAnnotations;
 | 
						|
using System.Linq;
 | 
						|
using System.Text;
 | 
						|
using System.Threading.Tasks;
 | 
						|
 | 
						|
namespace IRaCIS.Core.Application.Contracts
 | 
						|
{
 | 
						|
 | 
						|
    public class UnionStudyBaseModel
 | 
						|
    {
 | 
						|
        public Guid TrialId { get; set; }
 | 
						|
 | 
						|
        public Guid SiteId { 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}";
 | 
						|
 | 
						|
                #region 废弃
 | 
						|
                //if (uploadTimeSpan.Seconds == 0 && uploadTimeSpan.Minutes==0 && uploadTimeSpan.Hours == 0)
 | 
						|
                //{
 | 
						|
                //    return $"{uploadTimeSpan.Milliseconds}毫秒";
 | 
						|
                //}
 | 
						|
                //else if (uploadTimeSpan.Minutes == 0 && uploadTimeSpan.Hours == 0)
 | 
						|
                //{
 | 
						|
                //    return $"{uploadTimeSpan.Seconds}秒";
 | 
						|
                //}
 | 
						|
                //else if (uploadTimeSpan.Hours == 0)
 | 
						|
                //{
 | 
						|
                //    return $"{uploadTimeSpan.Minutes} 分钟 {uploadTimeSpan.Seconds} 秒";
 | 
						|
                //}
 | 
						|
                //else
 | 
						|
                //{
 | 
						|
                //    return $" {uploadTimeSpan.Hours} 小时 {uploadTimeSpan.Minutes} 分钟 {uploadTimeSpan.Seconds} 秒 {uploadTimeSpan.Milliseconds}毫秒";
 | 
						|
                //}
 | 
						|
                #endregion
 | 
						|
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        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 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? SiteId { 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 class PreArchiveDicomStudyCommand
 | 
						|
    {
 | 
						|
      //public  string StudyInstanceUid { get; set; }
 | 
						|
 | 
						|
        [NotDefault]
 | 
						|
        public Guid TrialId { get; set; }
 | 
						|
        [NotDefault]
 | 
						|
        public Guid SiteId { get; set; }
 | 
						|
        [NotDefault]
 | 
						|
        public Guid SubjectId { get; set; }
 | 
						|
        [NotDefault]
 | 
						|
        public Guid SubjectVisitId { get; set; }
 | 
						|
 | 
						|
    
 | 
						|
        public decimal FileSize { get; set; }
 | 
						|
 | 
						|
        public bool IsDicomReUpload { get; set; }
 | 
						|
 | 
						|
 | 
						|
        public int FileCount { get; set; }
 | 
						|
    }
 | 
						|
 | 
						|
    public class NewArchiveStudyCommand
 | 
						|
    {
 | 
						|
        [NotDefault]
 | 
						|
        public Guid TrialId { get; set; }
 | 
						|
        [NotDefault]
 | 
						|
        public Guid SiteId { 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 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 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;
 | 
						|
    }
 | 
						|
}
 |