Exemplo n.º 1
0
        protected override InstancePreProcessingResult PreProcessFile(Model.WorkQueueUid uid, DicomFile file)
        {
            // Return a result indicating the file has been reconciled.
            InstancePreProcessingResult result = new InstancePreProcessingResult {
                AutoReconciled = true
            };

            return(result);
        }
Exemplo n.º 2
0
        protected override void ProcessFile(Model.WorkQueueUid queueUid, DicomFile file, ClearCanvas.Dicom.Utilities.Xml.StudyXml stream, bool compare)
        {
            Platform.CheckFalse(compare, "compare");

            SopInstanceProcessor processor = new SopInstanceProcessor(Context);

            FileInfo fileInfo = new FileInfo(file.Filename);
            long     fileSize = fileInfo.Length;

            processor.InstanceStats.FileSize = (ulong)fileSize;
            string sopInstanceUid = file.DataSet[DicomTags.SopInstanceUid].GetString(0, "File:" + fileInfo.Name);

            processor.InstanceStats.Description = sopInstanceUid;

            if (Study != null)
            {
                StudyComparer        comparer = new StudyComparer();
                DifferenceCollection list     = comparer.Compare(file, Study, ServerPartition.GetComparisonOptions());
                if (list != null && list.Count > 0)
                {
                    Platform.Log(LogLevel.Warn, "Dicom file contains information inconsistent with the study in the system");
                }
            }

            string groupID = ServerHelper.GetUidGroup(file, StorageLocation.ServerPartition, WorkQueueItem.InsertTime);

            processor.ProcessFile(groupID, file, stream, false, false, null, null);

            Statistics.StudyInstanceUid = StorageLocation.StudyInstanceUid;
            if (String.IsNullOrEmpty(processor.Modality) == false)
            {
                Statistics.Modality = processor.Modality;
            }

            // Update the statistics
            Statistics.NumInstances++;
        }