コード例 #1
0
 private static string MakeTitle(WorklistItemSummaryBase worklistItem)
 {
     return(string.Format(SR.FormatTitleContextDescriptionReviewOrderNoteConversation,
                          PersonNameFormat.Format(worklistItem.PatientName),
                          MrnFormat.Format(worklistItem.Mrn),
                          AccessionFormat.Format(worklistItem.AccessionNumber)));
 }
コード例 #2
0
        protected bool ExecuteCore(WorklistItemSummaryBase item)
        {
            // first check for warnings
            var warnings = new List <string>();

            Platform.GetService <IOrderEntryService>(
                service => warnings = service.QueryCancelOrderWarnings(new QueryCancelOrderWarningsRequest(item.OrderRef)).Warnings);

            if (warnings.Count > 0)
            {
                var warn   = CollectionUtils.FirstElement(warnings);
                var action = this.Context.DesktopWindow.ShowMessageBox(
                    warn + "\n\nAre you sure you want to cancel and replace this order?",
                    MessageBoxActions.YesNo);
                if (action == DialogBoxAction.No)
                {
                    return(false);
                }
            }

            var title = string.Format("Replace Order {0} - {1} {2}",
                                      AccessionFormat.Format(item.AccessionNumber),
                                      PersonNameFormat.Format(item.PatientName),
                                      MrnFormat.Format(item.Mrn));
            var component = new OrderEditorComponent(new OrderEditorComponent.ReplaceOrderOperatingContext {
                OrderRef = item.OrderRef
            });
            var result = ApplicationComponent.LaunchAsDialog(
                this.Context.DesktopWindow,
                component,
                title);

            if (result == ApplicationComponentExitCode.Accepted)
            {
                InvalidateFolders();
                return(true);
            }

            return(false);
        }
コード例 #3
0
        protected bool ExecuteCore(WorklistItemSummaryBase item)
        {
            var title = string.Format("Modify Order {0} - {1} {2}",
                                      AccessionFormat.Format(item.AccessionNumber),
                                      PersonNameFormat.Format(item.PatientName),
                                      MrnFormat.Format(item.Mrn));
            var component = new OrderEditorComponent(new OrderEditorComponent.ModifyOrderOperatingContext {
                OrderRef = item.OrderRef
            });
            var result = ApplicationComponent.LaunchAsDialog(
                this.Context.DesktopWindow,
                component,
                title);

            if (result == ApplicationComponentExitCode.Accepted)
            {
                InvalidateFolders();
                return(true);
            }

            return(false);
        }
コード例 #4
0
        private OrderNoteboxTable(int cellRowCount)
            : base(cellRowCount)
        {
            var resolver = new ResourceResolver(this.GetType().Assembly);

            var urgentColumn = new TableColumn <OrderNoteboxItemSummary, IconSet>(SR.ColumnUrgent,
                                                                                  item => item.Urgent ? new IconSet("SingleExclamation.png") : null, 0.3f)
            {
                Comparison       = (item1, item2) => item1.Urgent.CompareTo(item2.Urgent),
                ResourceResolver = resolver
            };

            this.Columns.Add(urgentColumn);

            /* JR: this isn't needed right now, because acknowledged notes are never shown.
             * TableColumn<OrderNoteboxItemSummary, IconSet> acknowledgedColumn =
             *      new TableColumn<OrderNoteboxItemSummary, IconSet>(SR.ColumnStatus,
             *              delegate(OrderNoteboxItemSummary item) { return GetIsAcknowledgedIcon(item.IsAcknowledged); },
             *              0.3f);
             * acknowledgedColumn.Comparison = delegate(OrderNoteboxItemSummary item1, OrderNoteboxItemSummary item2)
             *      { return item1.IsAcknowledged.CompareTo(item2.IsAcknowledged); };
             * acknowledgedColumn.ResourceResolver = resolver;
             * this.Columns.Add(acknowledgedColumn);
             */

            this.Columns.Add(new TableColumn <OrderNoteboxItemSummary, string>(SR.ColumnMRN, item => MrnFormat.Format(item.Mrn), 1.0f));
            this.Columns.Add(new TableColumn <OrderNoteboxItemSummary, string>(SR.ColumnPatientName, item => PersonNameFormat.Format(item.PatientName), 1.0f));
            this.Columns.Add(new TableColumn <OrderNoteboxItemSummary, string>(SR.ColumnDescription,
                                                                               item => string.Format("{0} {1}", AccessionFormat.Format(item.AccessionNumber), item.DiagnosticServiceName),
                                                                               1.0f, 1));

            this.Columns.Add(new TableColumn <OrderNoteboxItemSummary, string>(SR.ColumnFrom,
                                                                               item => item.OnBehalfOfGroup != null
                                        ? String.Format(SR.FormatFromOnBehalf, StaffNameAndRoleFormat.Format(item.Author), item.OnBehalfOfGroup.Name, item.PostTime)
                                        : String.Format(SR.FormatFrom, StaffNameAndRoleFormat.Format(item.Author), item.PostTime),
                                                                               1.0f, 2));

            this.Columns.Add(new TableColumn <OrderNoteboxItemSummary, string>(SR.ColumnTo,
                                                                               item => String.Format(SR.FormatTo, RecipientsList(item.StaffRecipients, item.GroupRecipients)),
                                                                               1.0f, 3));

            this.Columns.Add(_postTimeColumn = new DateTimeTableColumn <OrderNoteboxItemSummary>(SR.ColumnPostTime,
                                                                                                 item => item.PostTime));
            _postTimeColumn.Visible = false;

            this.Sort(new TableSortParams(_postTimeColumn, false));
        }
コード例 #5
0
            /// <summary>
            /// Formats the specified MRN (must be a JSML encoded <see cref="CompositeIdentifierDetail"/> object).
            /// </summary>
            /// <param name="jsml"></param>
            /// <returns></returns>
            public string FormatMrn(string jsml)
            {
                var mrnDetail = JsmlSerializer.Deserialize <CompositeIdentifierDetail>(jsml);

                return(mrnDetail == null ? "" : MrnFormat.Format(mrnDetail));
            }
コード例 #6
0
 public PatientProfileTable()
 {
     this.Columns.Add(
         new TableColumn <PatientProfileSummary, string>(SR.ColumnMRN,
                                                         delegate(PatientProfileSummary profile) { return(MrnFormat.Format(profile.Mrn)); }, 1.0f));
     this.Columns.Add(
         new TableColumn <PatientProfileSummary, string>(SR.ColumnPatientName,
                                                         delegate(PatientProfileSummary profile) { return(PersonNameFormat.Format(profile.Name)); }, 2.0f));
     this.Columns.Add(
         new TableColumn <PatientProfileSummary, string>(SR.ColumnHealthcardNumber,
                                                         delegate(PatientProfileSummary profile) { return(HealthcardFormat.Format(profile.Healthcard)); }, 1.0f));
     this.Columns.Add(
         new DateTableColumn <PatientProfileSummary>(SR.ColumnDateOfBirth,
                                                     delegate(PatientProfileSummary profile) { return(profile.DateOfBirth); }, 1.0f));
     this.Columns.Add(
         new TableColumn <PatientProfileSummary, string>(SR.ColumnSex,
                                                         delegate(PatientProfileSummary profile) { return(profile.Sex.Value); }, 0.5f));
 }
コード例 #7
0
        public WorklistItemTable()
            : base(NumRows)
        {
            // Visible Columns
            var priorityColumn = new TableColumn <TItem, IconSet>(SR.ColumnPriority, item => GetPriorityIcon(item.OrderPriority), 0.2f)
            {
                Comparison       = ComparePriorities,
                ResourceResolver = new ResourceResolver(this.GetType().Assembly)
            };

            var mrnColumn          = new TableColumn <TItem, string>(SR.ColumnMRN, item => MrnFormat.Format(item.Mrn), 0.9f);
            var nameColumn         = new TableColumn <TItem, string>(SR.ColumnName, item => PersonNameFormat.Format(item.PatientName), 1.5f);
            var scheduledForColumn = new DateTimeTableColumn <TItem>(SR.ColumnTime, item => item.Time, 1.1f);
            var descriptionRow     = new TableColumn <TItem, string>(SR.ColumnDescription, FormatDescription, 1.0f, DescriptionRow);

            // Invisible but sortable columns
            var patientClassColumn = new TableColumn <TItem, string>(SR.ColumnPatientClass, FormatPatientClass, 1.0f)
            {
                Visible = false
            };

            var accessionNumberColumn = new TableColumn <TItem, string>(SR.ColumnAccessionNumber,
                                                                        item => AccessionFormat.Format(item.AccessionNumber), 1.0f)
            {
                Visible = false
            };

            var procedureNameColumn = new TableColumn <TItem, string>(SR.ColumnProcedure, ProcedureFormat.Format, 1.0f)
            {
                Visible = false
            };

            // The order of the addition determines the order of SortBy dropdown
            this.Columns.Add(priorityColumn);
            this.Columns.Add(mrnColumn);
            this.Columns.Add(nameColumn);
            this.Columns.Add(patientClassColumn);
            this.Columns.Add(procedureNameColumn);
            this.Columns.Add(accessionNumberColumn);
            this.Columns.Add(scheduledForColumn);
            this.Columns.Add(descriptionRow);

            // Sort the table by Scheduled Time initially
            this.Sort(new TableSortParams(scheduledForColumn, true));
        }
コード例 #8
0
ファイル: ProtocolDocument.cs プロジェクト: hksonngan/Xian
 public static string GetTitle(ReportingWorklistItemSummary item)
 {
     return(string.Format("Protocol - {0} - {1}", PersonNameFormat.Format(item.PatientName), MrnFormat.Format(item.Mrn)));
 }
コード例 #9
0
 public override string GetTitle()
 {
     return(string.Format("Performing - {0} - {1}", PersonNameFormat.Format(_item.PatientName), MrnFormat.Format(_item.Mrn)));
 }
コード例 #10
0
        private static void NewOrder(PatientProfileSummary patientProfile, IDesktopWindow desktopWindow)
        {
            if (patientProfile == null)
            {
                NewOrder(null, "New Order", desktopWindow);
                return;
            }

            var title = string.Format(SR.TitleNewOrder, PersonNameFormat.Format(patientProfile.Name), MrnFormat.Format(patientProfile.Mrn));

            NewOrder(patientProfile, title, desktopWindow);
        }
コード例 #11
0
        private void LoadPatientProfile()
        {
            Async.CancelPending(this);

            if (_profileRef == null)
            {
                return;
            }

            Async.Request(this,
                          (IBrowsePatientDataService service) =>
            {
                var request = new GetDataRequest
                {
                    GetPatientProfileDetailRequest = new GetPatientProfileDetailRequest
                    {
                        PatientProfileRef = _profileRef,
                        // include notes for the notes component
                        IncludeNotes = true,
                        // include attachments for the docs component
                        IncludeAttachments = true,
                        // include patient allergies for allergies component
                        IncludeAllergies = true
                    }
                };

                return(service.GetData(request));
            },
                          response =>
            {
                _patientProfile = response.GetPatientProfileDetailResponse.PatientProfile;

                this.Host.Title = string.Format(SR.TitleBiography, PersonNameFormat.Format(_patientProfile.Name), MrnFormat.Format(_patientProfile.Mrn));
                _bannerComponent.HealthcareContext = _patientProfile;
                _documentComponent.Attachments     = _patientProfile.Attachments;
                _noteComponent.Notes        = _patientProfile.Notes;
                _allergyComponent.Allergies = _patientProfile.Allergies;

                NotifyPropertyChanged("SelectedOrder");
                NotifyAllPropertiesChanged();
            },
                          exception =>
            {
                ExceptionHandler.Report(exception, this.Host.DesktopWindow);

                _patientProfile = null;
                _bannerComponent.HealthcareContext = null;
                _documentComponent.Attachments     = new List <AttachmentSummary>();
                _noteComponent.Notes = new List <PatientNoteDetail>();

                NotifyPropertyChanged("SelectedOrder");
                NotifyAllPropertiesChanged();
            });
        }
コード例 #12
0
        public override void Start()
        {
            Platform.GetService <IPatientAdminService>(
                service =>
            {
                var formData = service.LoadPatientProfileEditorFormData(new LoadPatientProfileEditorFormDataRequest());
                if (_isNew)
                {
                    _profile = new PatientProfileDetail();
                    _profile.Mrn.AssigningAuthority = formData.MrnAssigningAuthorityChoices.Count > 0
                                                        ? GetWorkingFacilityInformationAuthority(formData.MrnAssigningAuthorityChoices)
                                                        : null;
                    _profile.Healthcard.AssigningAuthority = formData.HealthcardAssigningAuthorityChoices.Count > 0
                                                        ? formData.HealthcardAssigningAuthorityChoices[0]
                                                        : null;
                    _profile.Sex         = formData.SexChoices[0];
                    _profile.DateOfBirth = Platform.Time.Date;
                }
                else
                {
                    var response = service.LoadPatientProfileForEdit(new LoadPatientProfileForEditRequest(_profileRef));

                    _profileRef = response.PatientProfileRef;
                    _profile    = response.PatientDetail;

                    this.Host.Title =
                        string.Format(SR.TitlePatientComponent, PersonNameFormat.Format(_profile.Name), MrnFormat.Format(_profile.Mrn));
                }

                if (_newAttachments.Count > 0)
                {
                    _profile.Attachments.AddRange(_newAttachments);
                    this.Modified      = true;
                    this.AcceptEnabled = true;
                }

                // if the user has permission to either a) create a new patient, or b) update the patient profile, then
                // these pages should be displayed
                if (Thread.CurrentPrincipal.IsInRole(
                        ClearCanvas.Ris.Application.Common.AuthorityTokens.Workflow.PatientProfile.Update) ||
                    Thread.CurrentPrincipal.IsInRole(ClearCanvas.Ris.Application.Common.AuthorityTokens.Workflow.Patient.Create))
                {
                    this.Pages.Add(
                        new NavigatorPage("NodePatient",
                                          _patientEditor =
                                              new PatientProfileDetailsEditorComponent(
                                                  _isNew,
                                                  formData.MrnAutoGenerated,
                                                  formData.SexChoices,
                                                  formData.MrnAssigningAuthorityChoices,
                                                  formData.HealthcardAssigningAuthorityChoices)));
                    this.Pages.Add(
                        new NavigatorPage("NodePatient/NodeAddresses",
                                          _addressesSummary = new AddressesSummaryComponent(formData.AddressTypeChoices)));
                    this.Pages.Add(
                        new NavigatorPage("NodePatient/NodePhoneNumbers",
                                          _phoneNumbersSummary = new PhoneNumbersSummaryComponent(formData.PhoneTypeChoices)));
                    this.Pages.Add(
                        new NavigatorPage("NodePatient/NodeEmailAddresses",
                                          _emailAddressesSummary = new EmailAddressesSummaryComponent()));
                    this.Pages.Add(
                        new NavigatorPage("NodePatient/NodeContactPersons",
                                          _contactPersonsSummary =
                                              new ContactPersonsSummaryComponent(formData.ContactPersonTypeChoices, formData.ContactPersonRelationshipChoices)));
                    this.Pages.Add(
                        new NavigatorPage("NodePatient/NodeCulture",
                                          _additionalPatientInfoSummary =
                                              new PatientProfileAdditionalInfoEditorComponent(formData.ReligionChoices, formData.PrimaryLanguageChoices)));

                    _addressesSummary.SetModifiedOnListChange      = true;
                    _phoneNumbersSummary.SetModifiedOnListChange   = true;
                    _emailAddressesSummary.SetModifiedOnListChange = true;
                    _contactPersonsSummary.SetModifiedOnListChange = true;

                    _patientEditor.Subject                = _profile;
                    _addressesSummary.Subject             = _profile.Addresses;
                    _phoneNumbersSummary.Subject          = _profile.TelephoneNumbers;
                    _emailAddressesSummary.Subject        = _profile.EmailAddresses;
                    _contactPersonsSummary.Subject        = _profile.ContactPersons;
                    _additionalPatientInfoSummary.Subject = _profile;
                }

                // if the user has permission to either a) create a new patient, or b) update a patient, then
                // these pages should be displayed
                if (Thread.CurrentPrincipal.IsInRole(ClearCanvas.Ris.Application.Common.AuthorityTokens.Workflow.Patient.Create) ||
                    Thread.CurrentPrincipal.IsInRole(ClearCanvas.Ris.Application.Common.AuthorityTokens.Workflow.Patient.Update))
                {
                    this.Pages.Add(
                        new NavigatorPage("NodePatient/NodeNotes",
                                          _notesSummary   = new PatientNoteSummaryComponent(_profile.Notes, formData.NoteCategoryChoices)));
                    _notesSummary.SetModifiedOnListChange = true;

                    var patientDocumentsPage = new NavigatorPage("NodePatient/NodeAttachments",
                                                                 _documentSummary =
                                                                     new AttachedDocumentPreviewComponent(false, AttachmentSite.Patient));
                    this.Pages.Add(patientDocumentsPage);
                    _documentSummary.Attachments = _profile.Attachments;

                    if (_newAttachments.Count > 0)
                    {
                        this.MoveTo(this.Pages.IndexOf(patientDocumentsPage));
                        _documentSummary.SetInitialSelection(_newAttachments[0]);
                    }
                }

                this.ValidationStrategy = new AllComponentsValidationStrategy();
            });


            base.Start();
        }
コード例 #13
0
        public string FormatPatientProfile(object item)
        {
            var summary = (PatientProfileSummary)item;

            return(String.Format("{0} - {1}", MrnFormat.Format(summary.Mrn), PersonNameFormat.Format(summary.Name)));
        }