Пример #1
0
        public void DeleteStudy()
        {
            string reason;

            if (!_study.CanScheduleDelete(out reason))
            {
                MessageDialog.MessageType = MessageBox.MessageTypeEnum.ERROR;
                MessageDialog.Message     = reason;
                MessageDialog.Show();
            }
            else
            {
                //DeleteConfirmDialog.MessageType = MessageBox.MessageTypeEnum.YESNO;
                //DeleteConfirmDialog.Message = App_GlobalResources.SR.SingleStudyDelete;
                //DeleteConfirmDialog.Data = _study.TheStudy;

                //DeleteConfirmDialog.Show();
                List <StudySummary> studyList = new List <StudySummary> {
                    _study
                };

                DeleteStudyConfirmDialog.DeletingStudies = CollectionUtils.Map(
                    studyList,
                    delegate(StudySummary study)
                {
                    var info = new DeleteStudyInfo
                    {
                        StudyKey          = study.Key,
                        AccessionNumber   = study.AccessionNumber,
                        Modalities        = study.ModalitiesInStudy,
                        PatientId         = study.PatientId,
                        PatientsName      = study.PatientsName,
                        StudyDate         = study.StudyDate,
                        StudyDescription  = study.StudyDescription,
                        StudyInstanceUid  = study.StudyInstanceUid,
                        ServerPartitionAE = study.ThePartition.AeTitle
                    };
                    return(info);
                }
                    );

                DeleteStudyConfirmDialog.Show();
                updatepanel.Update();
            }
        }
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);



            if (Studies == null)
            {
                return;
            }

            foreach (GridViewRow row in StudyListControl.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    StudySummary study = Studies[row.RowIndex];

                    if (study != null)
                    {
                        row.Attributes.Add("instanceuid", study.StudyInstanceUid);
                        row.Attributes.Add("serverae", study.ThePartition.AeTitle);

                        string reason;
                        if (study.CanScheduleDelete(out reason))
                        {
                            row.Attributes.Add("candelete", "true");
                        }

                        if (study.CanScheduleMove(out reason))
                        {
                            row.Attributes.Add("canmove", "true");
                        }

                        if (study.CanScheduleRestore(out reason))
                        {
                            row.Attributes.Add("canrestore", "true");
                        }

                        if (study.CanViewImages(out reason))
                        {
                            row.Attributes.Add("canviewimages", "true");
                        }
                        else
                        {
                            row.Attributes.Add("canviewimagesreason", reason);
                        }

                        var status = (Label)row.FindControl("StudyStatusEnum");
                        status.Text = ServerEnumDescription.GetLocalizedDescription(study.StudyStatusEnum);


                        var qcStatusLink = (HtmlAnchor)row.FindControl("QCStatusLink");
                        if (qcStatusLink != null)
                        {
                            var processing = study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.ProcessingScheduled) || study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.ProcessingScheduled);
                            if (string.IsNullOrEmpty(study.TheStudy.QCOutput))
                            {
                                if (!processing)
                                {
                                    qcStatusLink.InnerText = "N/A";
                                    qcStatusLink.HRef      = ResolveClientUrl(string.Format("~/Pages/Studies/StudyQCReport.aspx?PartitionAE={0}&StudyUid={1}",
                                                                                            study.ThePartition.AeTitle, study.TheStudy.StudyInstanceUid
                                                                                            ));
                                }
                                else
                                {
                                    qcStatusLink.InnerText = "";
                                }
                            }
                        }



                        LinkButton button = (LinkButton)row.FindControl("ReconcileLinkButton");
                        Label      label  = (Label)row.FindControl("SeparatorLabel");

                        if (study.IsReconcileRequired)
                        {
                            button.Visible = true;
                            label.Visible  = true;

                            button.PostBackUrl = ImageServerConstants.PageURLs.StudyIntegrityQueuePage +
                                                 "?PatientID=" + study.PatientId + "&PatientName=" + study.PatientsName + "&PartitionKey=" + study.ThePartition.GetKey();

                            button.Enabled = Context.User.IsInRole(AuthorityTokens.StudyIntegrityQueue.Search);
                        }
                        else
                        {
                            button.Visible = false;
                            label.Visible  = false;
                        }

                        button = (LinkButton)row.FindControl("QueueLinkButton");
                        label  = (Label)row.FindControl("QueueSeparatorLabel");

                        if (study.IsLocked)
                        {
                            button.Visible = true;

                            if (study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.RestoreScheduled))
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.RestoreQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(AuthorityTokens.RestoreQueue.Search);
                            }
                            else if (study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.ArchiveScheduled))
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.ArchiveQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(AuthorityTokens.ArchiveQueue.Search);
                            }
                            else
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.WorkQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(AuthorityTokens.WorkQueue.Search);
                            }
                        }
                        else
                        {
                            button.Visible = false;
                        }

                        label.Visible = button.Visible;
                    }
                }
            }
        }
Пример #3
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);



            if (Studies == null)
            {
                return;
            }

            foreach (GridViewRow row in StudyListControl.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    StudySummary study = Studies[row.RowIndex];

                    if (study != null)
                    {
                        row.Attributes.Add("instanceuid", study.StudyInstanceUid);
                        row.Attributes.Add("serverae", study.ThePartition.AeTitle);

                        string reason;
                        if (study.CanScheduleDelete(out reason))
                        {
                            row.Attributes.Add("candelete", "true");
                        }

                        if (study.CanScheduleMove(out reason))
                        {
                            row.Attributes.Add("canmove", "true");
                        }

                        if (study.CanScheduleRestore(out reason))
                        {
                            row.Attributes.Add("canrestore", "true");
                        }

                        if (study.CanViewImages(out reason))
                        {
                            row.Attributes.Add("canviewimages", "true");
                        }
                        else
                        {
                            row.Attributes.Add("canviewimagesreason", reason);
                        }

                        var status = (Label)row.FindControl("StudyStatusEnum");
                        status.Text = ServerEnumDescription.GetLocalizedDescription(study.StudyStatusEnum);

                        LinkButton button = (LinkButton)row.FindControl("ReconcileLinkButton");
                        Label      label  = (Label)row.FindControl("SeparatorLabel");

                        if (study.IsReconcileRequired)
                        {
                            button.Visible = true;
                            label.Visible  = true;

                            button.PostBackUrl = ImageServerConstants.PageURLs.StudyIntegrityQueuePage +
                                                 "?PatientID=" + study.PatientId + "&PatientName=" + study.PatientsName + "&PartitionKey=" + study.ThePartition.GetKey();

                            button.Enabled = Context.User.IsInRole(Enterprise.Authentication.AuthorityTokens.StudyIntegrityQueue.Search);
                        }
                        else
                        {
                            button.Visible = false;
                            label.Visible  = false;
                        }

                        button = (LinkButton)row.FindControl("QueueLinkButton");
                        label  = (Label)row.FindControl("QueueSeparatorLabel");

                        if (study.IsLocked)
                        {
                            button.Visible = true;

                            if (study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.RestoreScheduled))
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.RestoreQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(Enterprise.Authentication.AuthorityTokens.RestoreQueue.Search);
                            }
                            else if (study.QueueStudyStateEnum.Equals(QueueStudyStateEnum.ArchiveScheduled))
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.ArchiveQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(Enterprise.Authentication.AuthorityTokens.ArchiveQueue.Search);
                            }
                            else
                            {
                                button.PostBackUrl = ImageServerConstants.PageURLs.WorkQueuePage +
                                                     "?PatientID=" + Server.UrlEncode(study.PatientId) + "&PatientName=" + Server.UrlEncode(study.PatientsName) + "&PartitionKey=" +
                                                     study.ThePartition.Key;
                                button.Text    = ServerEnumDescription.GetLocalizedDescription(study.QueueStudyStateEnum);
                                button.Enabled = Context.User.IsInRole(Enterprise.Authentication.AuthorityTokens.WorkQueue.Search);
                            }
                        }
                        else
                        {
                            button.Visible = false;
                        }

                        label.Visible = button.Visible;
                    }
                }
            }
        }