예제 #1
0
 /// <summary>
 /// Creates an instance of <see cref="InsertSIQCommand"/> to insert a <see cref="StudyIntegrityQueue"/> entry
 /// for a <see cref="DicomFile"/>
 /// </summary>
 /// <param name="studyStorage">The <see cref="StudyStorageLocation"/> of the study</param>
 /// <param name="reason">A <see cref="StudyIntegrityReasonEnum"/> value indicating the type of <see cref="StudyIntegrityQueue"/> entry to be inserted.</param>
 /// <param name="file">The DICOM file that needs to be reconciled</param>
 /// <param name="uidGroup">The string value representing the group of images which the DICOM <paramref name="file"/> belongs to</param>
 /// <param name="reconcileImageStorage">The <see cref="ReconcileStorage"/> where the DICOM file will be stored.</param>
 public InsertSIQCommand(
     StudyStorageLocation studyStorage,
     StudyIntegrityReasonEnum reason,
     DicomFile file,
     string uidGroup,
     ReconcileStorage reconcileImageStorage
     )
     : base("Insert SIQ Command")
 {
     _storageLocation       = studyStorage;
     _reconcileImageStorage = reconcileImageStorage;
     _reason   = reason;
     _file     = file;
     _uidGroup = uidGroup;
 }
        public void Insert(Guid Guid, short EnumX, string Lookup, string Description, string LongDescription)
        {
            var item = new StudyIntegrityReasonEnum();

            item.Guid = Guid;

            item.EnumX = EnumX;

            item.Lookup = Lookup;

            item.Description = Description;

            item.LongDescription = LongDescription;


            item.Save(UserName);
        }
예제 #3
0
        /// <summary>
        /// Inserts a <see cref="StudyIntegrityQueue"/> entry for manual reconciliation.
        /// </summary>
        /// <param name="file">The DICOM file that needs to be reconciled.</param>
        /// <param name="reason">The type of <see cref="StudyIntegrityQueue"/> entry to be inserted.</param>
        /// <param name="uid">A UID to delete on insert.</param>
        /// <remarks>
        /// A copy of the DICOM file will be stored in a special folder allocated for
        /// reconciliation purpose. The caller is responsible for managing the original copy.
        /// </remarks>
        public void ScheduleReconcile(DicomFile file, StudyIntegrityReasonEnum reason, WorkQueueUid uid)
        {
            Platform.CheckForNullReference(_context.StudyLocation, "_context.StudyLocation");

            Platform.Log(LogLevel.Info, "Scheduling new manual reconciliation for SOP {0}", file.MediaStorageSopInstanceUid);
            ServerFilesystemInfo fs = FilesystemMonitor.Instance.GetFilesystemInfo(_context.StudyLocation.FilesystemKey);

            Platform.CheckForNullReference(fs, "fs");

            ReconcileStorage reconcileStorage = new ReconcileStorage(_context.StudyLocation, _context.Group);

            using (ServerCommandProcessor processor = new ServerCommandProcessor("Schedule Manual Reconciliation"))
            {
                string        path = reconcileStorage.GetSopInstancePath(file.DataSet[DicomTags.SopInstanceUid].ToString());
                DirectoryInfo dir  = new DirectoryInfo(path);
                if (dir.Parent != null)
                {
                    CreateDirectoryCommand mkdir = new CreateDirectoryCommand(dir.Parent.FullName);
                    processor.AddCommand(mkdir);
                }

                SaveDicomFileCommand saveFileCommand = new SaveDicomFileCommand(path, file, true);
                processor.AddCommand(saveFileCommand);

                InsertSIQCommand updateStudyCommand = new InsertSIQCommand(_context.StudyLocation, reason, file, _context.Group, reconcileStorage);
                processor.AddCommand(updateStudyCommand);

                if (uid != null)
                {
                    processor.AddCommand(new DeleteWorkQueueUidCommand(uid));
                }

                if (processor.Execute() == false)
                {
                    throw new ApplicationException(String.Format("Unable to schedule image reconcilation : {0}", processor.FailureReason), processor.FailureException);
                }
            }
        }
예제 #4
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            ClearFromDateButton.OnClientClick = ScriptHelper.ClearDate(FromDate.ClientID,
                                                                       FromDateCalendarExtender.ClientID);
            ClearToDateButton.OnClientClick = ScriptHelper.ClearDate(ToDate.ClientID,
                                                                     ToDateCalendarExtender.ClientID);
            ToDate.Attributes["OnChange"] = ScriptHelper.CheckDateRange(FromDate.ClientID, ToDate.ClientID,
                                                                        ToDate.ClientID, ToDateCalendarExtender.ClientID,
                                                                        "To Date must be greater than From Date");
            FromDate.Attributes["OnChange"] = ScriptHelper.CheckDateRange(FromDate.ClientID, ToDate.ClientID,
                                                                          FromDate.ClientID,
                                                                          FromDateCalendarExtender.ClientID,
                                                                          "From Date must be less than To Date");

            GridPagerTop.InitializeGridPager(Labels.GridPagerQueueSingleItem,
                                             Labels.GridPagerQueueMultipleItems,
                                             StudyIntegrityQueueItemList.StudyIntegrityQueueGrid,
                                             () => StudyIntegrityQueueItemList.ResultCount,
                                             ImageServerConstants.GridViewPagerPosition.Top);
            StudyIntegrityQueueItemList.Pager = GridPagerTop;

            StudyIntegrityQueueItemList.DataSourceCreated += delegate(StudyIntegrityQueueDataSource source)
            {
                source.Partition = ServerPartition;

                if (!String.IsNullOrEmpty(PatientName.Text))
                {
                    source.PatientName = SearchHelper.NameWildCard(PatientName.Text);
                }
                if (!String.IsNullOrEmpty(PatientId.Text))
                {
                    source.PatientId = SearchHelper.TrailingWildCard(PatientId.Text);
                }
                if (!String.IsNullOrEmpty(AccessionNumber.Text))
                {
                    source.AccessionNumber = SearchHelper.TrailingWildCard(AccessionNumber.Text);
                }
                if (!String.IsNullOrEmpty(FromDate.Text))
                {
                    source.FromInsertTime = FromDate.Text;
                }

                if (!String.IsNullOrEmpty(ToDate.Text))
                {
                    source.ToInsertTime = ToDate.Text;
                }

                if (ReasonListBox.SelectedIndex > -1)
                {
                    var reasonEnums =
                        new List <StudyIntegrityReasonEnum>();
                    foreach (ListItem item in ReasonListBox.Items)
                    {
                        if (item.Selected)
                        {
                            reasonEnums.Add(
                                StudyIntegrityReasonEnum.GetEnum(
                                    item.Value));
                        }
                    }

                    source.ReasonEnum = reasonEnums;
                }
            };

            ReconcileButton.Roles =
                AuthorityTokens.StudyIntegrityQueue.Reconcile;

            List <StudyIntegrityReasonEnum> reasons = StudyIntegrityReasonEnum.GetAll();

            foreach (StudyIntegrityReasonEnum reason in reasons)
            {
                ReasonListBox.Items.Add(new ListItem(ServerEnumDescription.GetLocalizedDescription(reason), reason.Lookup));
            }
        }
        public void Update(Guid Guid, short EnumX, string Lookup, string Description, string LongDescription)
        {
            var item = new StudyIntegrityReasonEnum();
            item.MarkOld();
            item.IsLoaded = true;

            item.Guid = Guid;

            item.EnumX = EnumX;

            item.Lookup = Lookup;

            item.Description = Description;

            item.LongDescription = LongDescription;

            item.Save(UserName);
        }