예제 #1
0
 public MongoRejectedKeyInfoDoc(
     [NotNull] MongoExtractionMessageHeaderDoc header,
     [NotNull] Dictionary <string, int> rejectionInfo)
 {
     Header        = header ?? throw new ArgumentNullException(nameof(header));
     RejectionInfo = rejectionInfo ?? throw new ArgumentNullException(nameof(rejectionInfo));
 }
예제 #2
0
 public MongoExtractJobDoc(
     Guid extractionJobIdentifier,
     [NotNull] MongoExtractionMessageHeaderDoc header,
     [NotNull] string projectNumber,
     ExtractJobStatus jobStatus,
     [NotNull] string extractionDirectory,
     DateTime jobSubmittedAt,
     [NotNull] string keyTag,
     uint keyCount,
     [CanBeNull] string extractionModality,
     bool isIdentifiableExtraction,
     bool isNoFilterExtraction,
     [CanBeNull] MongoFailedJobInfoDoc failedJobInfoDoc)
 {
     ExtractionJobIdentifier = (extractionJobIdentifier != default(Guid)) ? extractionJobIdentifier : throw new ArgumentException(nameof(extractionJobIdentifier));
     Header = header ?? throw new ArgumentNullException(nameof(header));
     ProjectNumber = (!string.IsNullOrWhiteSpace(projectNumber)) ? projectNumber : throw new ArgumentNullException(nameof(projectNumber));
     JobStatus = (jobStatus != ExtractJobStatus.Unknown) ? jobStatus : throw new ArgumentNullException(nameof(jobStatus));
     ExtractionDirectory = (!string.IsNullOrWhiteSpace(extractionDirectory)) ? extractionDirectory : throw new ArgumentNullException(nameof(extractionDirectory));
     JobSubmittedAt = (jobSubmittedAt != default(DateTime)) ? jobSubmittedAt : throw new ArgumentException(nameof(jobSubmittedAt));
     KeyTag = (!string.IsNullOrWhiteSpace(keyTag)) ? keyTag : throw new ArgumentNullException(nameof(keyTag));
     KeyCount = (keyCount > 0) ? keyCount : throw new ArgumentNullException(nameof(keyCount));
     if (extractionModality != null)
         ExtractionModality = (!string.IsNullOrWhiteSpace(extractionModality)) ? extractionModality : throw new ArgumentNullException(nameof(extractionModality));
     IsIdentifiableExtraction = isIdentifiableExtraction;
     IsNoFilterExtraction = isNoFilterExtraction;
     FailedJobInfoDoc = failedJobInfoDoc;
 }
예제 #3
0
 public static MongoRejectedKeyInfoDoc FromMessage(
     [NotNull] ExtractFileCollectionInfoMessage message,
     [NotNull] IMessageHeader header,
     [NotNull] DateTimeProvider dateTimeProvider)
 {
     return(new MongoRejectedKeyInfoDoc(
                MongoExtractionMessageHeaderDoc.FromMessageHeader(message.ExtractionJobIdentifier, header, dateTimeProvider),
                message.RejectionReasons
                ));
 }
예제 #4
0
 public static MongoExpectedFilesDoc FromMessage(
     [NotNull] ExtractFileCollectionInfoMessage message,
     [NotNull] IMessageHeader header,
     [NotNull] DateTimeProvider dateTimeProvider)
 {
     return(new MongoExpectedFilesDoc(
                MongoExtractionMessageHeaderDoc.FromMessageHeader(message.ExtractionJobIdentifier, header, dateTimeProvider),
                message.KeyValue,
                new HashSet <MongoExpectedFileInfoDoc>(message.ExtractFileMessagesDispatched.Select(x => new MongoExpectedFileInfoDoc(x.Key.MessageGuid, x.Value))),
                MongoRejectedKeyInfoDoc.FromMessage(message, header, dateTimeProvider)));
 }
예제 #5
0
 public MongoExpectedFilesDoc(
     [NotNull] MongoExtractionMessageHeaderDoc header,
     [NotNull] string key,
     [NotNull] HashSet <MongoExpectedFileInfoDoc> expectedFiles,
     [NotNull] MongoRejectedKeyInfoDoc rejectedKeys)
 {
     Header        = header ?? throw new ArgumentNullException(nameof(header));
     Key           = (!string.IsNullOrWhiteSpace(key)) ? key : throw new ArgumentNullException(nameof(key));
     ExpectedFiles = expectedFiles ?? throw new ArgumentNullException(nameof(expectedFiles));
     RejectedKeys  = rejectedKeys ?? throw new ArgumentNullException(nameof(rejectedKeys));
 }
예제 #6
0
 public static MongoExtractJobDoc FromMessage(
     [NotNull] ExtractionRequestInfoMessage message,
     [NotNull] IMessageHeader header,
     [NotNull] DateTimeProvider dateTimeProvider)
 {
     return new MongoExtractJobDoc(
         message.ExtractionJobIdentifier,
         MongoExtractionMessageHeaderDoc.FromMessageHeader(message.ExtractionJobIdentifier, header, dateTimeProvider),
         message.ProjectNumber,
         ExtractJobStatus.WaitingForCollectionInfo,
         message.ExtractionDirectory,
         message.JobSubmittedAt,
         message.KeyTag,
         (uint)message.KeyValueCount,
         message.ExtractionModality,
         message.IsIdentifiableExtraction,
         message.IsNoFilterExtraction,
         null
     );
 }
예제 #7
0
 public MongoFileStatusDoc(
     [NotNull] MongoExtractionMessageHeaderDoc header,
     [NotNull] string dicomFilePath,
     [CanBeNull] string outputFileName,
     bool wasAnonymised,
     bool isIdentifiable,
     ExtractedFileStatus extractedFileStatus,
     [CanBeNull] string statusMessage)
 {
     Header              = header ?? throw new ArgumentNullException(nameof(header));
     DicomFilePath       = dicomFilePath ?? throw new ArgumentNullException(nameof(dicomFilePath));
     OutputFileName      = outputFileName;
     WasAnonymised       = wasAnonymised;
     IsIdentifiable      = isIdentifiable;
     ExtractedFileStatus = (extractedFileStatus != ExtractedFileStatus.None) ? extractedFileStatus : throw new ArgumentException(nameof(extractedFileStatus));
     StatusMessage       = statusMessage;
     if (!IsIdentifiable && string.IsNullOrWhiteSpace(statusMessage))
     {
         throw new ArgumentNullException(nameof(statusMessage));
     }
 }