Beispiel #1
0
        protected void SearchButton_Click(object sender, ImageClickEventArgs e)
        {
            if (DisplaySearchWarning)
            {
                StudyListGridView.DataBindOnPreRender     = false;
                ConfirmStudySearchMessageBox.Message      = SR.NoFiltersSearchWarning;
                ConfirmStudySearchMessageBox.MessageStyle = "font-weight: bold; color: #205F87;";
                ConfirmStudySearchMessageBox.Show();
            }
            else
            {
                StudyListGridView.Refresh();
            }
            var sb = new StringBuilder();

            if (!String.IsNullOrEmpty(PatientId.TrimText))
            {
                sb.AppendFormat("PatientId={0};", PatientId.TrimText);
            }
            if (!String.IsNullOrEmpty(PatientName.TrimText))
            {
                sb.AppendFormat("PatientsName={0};", PatientName.TrimText);
            }
            if (!String.IsNullOrEmpty(AccessionNumber.TrimText))
            {
                sb.AppendFormat("AccessionNumber={0};", AccessionNumber.TrimText);
            }
            if (!String.IsNullOrEmpty(ToStudyDate.Text) || !String.IsNullOrEmpty(FromStudyDate.Text))
            {
                sb.AppendFormat("StudyDate={0}-{1};", FromStudyDate.Text, ToStudyDate.Text);
            }
            if (!String.IsNullOrEmpty(StudyDescription.TrimText))
            {
                sb.AppendFormat("StudyDescription={0};", StudyDescription.TrimText);
            }
            if (ModalityListBox.SelectedIndex < 0)
            {
                bool first = true;
                foreach (ListItem item in ModalityListBox.Items)
                {
                    if (!item.Selected)
                    {
                        continue;
                    }

                    if (first)
                    {
                        sb.AppendFormat("ModalitiesInStudy={0}", item.Value);
                        first = false;
                    }
                    else
                    {
                        sb.AppendFormat(",{0}", item.Value);
                    }
                }
                if (!first)
                {
                    sb.Append(';');
                }
            }

            var helper = new QueryAuditHelper(ServerPlatform.AuditSource, EventIdentificationContentsEventOutcomeIndicator.Success,
                                              new AuditPersonActiveParticipant(SessionManager.Current.Credentials.UserName,
                                                                               null,
                                                                               SessionManager.Current.Credentials.DisplayName),
                                              ServerPartition.AeTitle, ServerPlatform.HostId, sb.ToString());

            ServerAuditHelper.LogAuditMessage(helper);
        }
Beispiel #2
0
        private void SetupChildControls()
        {
            foreach (StudyStatusEnum s in  StudyStatusEnum.GetAll())
            {
                StatusListBox.Items.Add(new ListItem {
                    Text = ServerEnumDescription.GetLocalizedDescription(s), Value = s.Lookup
                });
            }

            ClearToStudyDateButton.Attributes["onclick"]   = ScriptHelper.ClearDate(ToStudyDate.ClientID, ToStudyDateCalendarExtender.ClientID);
            ClearFromStudyDateButton.Attributes["onclick"] = ScriptHelper.ClearDate(FromStudyDate.ClientID, FromStudyDateCalendarExtender.ClientID);
            SearchButton.Attributes["onclick"]             = ScriptHelper.CheckDateRange(FromStudyDate.ClientID, ToStudyDate.ClientID, "To Date must be greater than From Date");

            GridPagerTop.InitializeGridPager(SR.GridPagerStudySingleItem, SR.GridPagerStudyMultipleItems, StudyListGridView.TheGrid,
                                             () => StudyListGridView.ResultCount, ImageServerConstants.GridViewPagerPosition.Top);
            StudyListGridView.Pager = GridPagerTop;

            ConfirmStudySearchMessageBox.Confirmed += delegate
            {
                StudyListGridView.DataBindOnPreRender =
                    true;
                StudyListGridView.Refresh();
                if (SearchUpdatePanel.UpdateMode ==
                    UpdatePanelUpdateMode.Conditional)
                {
                    SearchUpdatePanel.Update();
                }
            };
            ConfirmStudySearchMessageBox.Cancel += delegate
            {
                StudyListGridView.DataBindOnPreRender = false;
            };

            RestoreMessageBox.Confirmed += delegate(object data)
            {
                if (data is IList <Study> )
                {
                    var studies = data as IList <Study>;
                    foreach (Study study in studies)
                    {
                        _controller.RestoreStudy(study);
                    }
                }
                else if (data is IList <StudySummary> )
                {
                    var studies = data as IList <StudySummary>;
                    foreach (StudySummary study in studies)
                    {
                        _controller.RestoreStudy(study.TheStudy);
                    }
                }
                else if (data is Study)
                {
                    var study = data as Study;
                    _controller.RestoreStudy(study);
                }

                DataBind();
                SearchUpdatePanel.Update();                 // force refresh
            };

            StudyListGridView.DataSourceCreated += delegate(StudyDataSource source)
            {
                source.Partition   = ServerPartition;
                source.DateFormats = ToStudyDateCalendarExtender.Format;

                if (!String.IsNullOrEmpty(PatientId.TrimText))
                {
                    source.PatientId = SearchHelper.TrailingWildCard(PatientId.TrimText);
                }
                if (!String.IsNullOrEmpty(PatientName.TrimText))
                {
                    source.PatientName = SearchHelper.NameWildCard(PatientName.TrimText);
                }
                if (!String.IsNullOrEmpty(AccessionNumber.TrimText))
                {
                    source.AccessionNumber = SearchHelper.TrailingWildCard(AccessionNumber.TrimText);
                }
                if (!String.IsNullOrEmpty(ToStudyDate.Text))
                {
                    source.ToStudyDate = ToStudyDate.Text;
                }
                if (!String.IsNullOrEmpty(FromStudyDate.Text))
                {
                    source.FromStudyDate = FromStudyDate.Text;
                }
                if (!String.IsNullOrEmpty(StudyDescription.TrimText))
                {
                    source.StudyDescription = SearchHelper.LeadingAndTrailingWildCard(StudyDescription.TrimText);
                }
                if (!String.IsNullOrEmpty(ReferringPhysiciansName.TrimText))
                {
                    source.ReferringPhysiciansName = SearchHelper.NameWildCard(ReferringPhysiciansName.TrimText);
                }
                if (!String.IsNullOrEmpty(ResponsiblePerson.TrimText))
                {
                    source.ResponsiblePerson = SearchHelper.NameWildCard(ResponsiblePerson.TrimText);
                }
                if (!String.IsNullOrEmpty(ResponsibleOrganization.TrimText))
                {
                    source.ResponsibleOrganization = SearchHelper.NameWildCard(ResponsibleOrganization.TrimText);
                }

                if (ModalityListBox.SelectedIndex > -1)
                {
                    var modalities = new List <string>();
                    foreach (ListItem item in ModalityListBox.Items)
                    {
                        if (item.Selected)
                        {
                            modalities.Add(item.Value);
                        }
                    }
                    source.Modalities = modalities.ToArray();
                }

                if (StatusListBox.SelectedIndex > -1)
                {
                    var statuses = new List <string>();
                    foreach (ListItem status in StatusListBox.Items)
                    {
                        if (status.Selected)
                        {
                            statuses.Add(status.Value);
                        }
                    }
                    source.Statuses = statuses.ToArray();
                }
            };

            //Set Roles
            ViewImagesButton.Roles            = AuthorityTokens.Study.ViewImages;
            ViewStudyDetailsButton.Roles      = AuthorityTokens.Study.View;
            MoveStudyButton.Roles             = AuthorityTokens.Study.Move;
            DeleteStudyButton.Roles           = AuthorityTokens.Study.Delete;
            RestoreStudyButton.Roles          = AuthorityTokens.Study.Restore;
            AssignAuthorityGroupsButton.Roles = MatrixPACS.ImageServer.Common.Authentication.AuthorityTokens.Study.EditDataAccess;
        }