private static string MakeTitle(WorklistItemSummaryBase worklistItem)
 {
     return(string.Format(SR.FormatTitleContextDescriptionReviewOrderNoteConversation,
                          PersonNameFormat.Format(worklistItem.PatientName),
                          MrnFormat.Format(worklistItem.Mrn),
                          AccessionFormat.Format(worklistItem.AccessionNumber)));
 }
Exemplo n.º 2
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));
        }
        protected bool ExecuteCore(WorklistItemSummaryBase item)
        {
            EnumValueInfo reason;
            var           reasonCode = OrderMergeSettings.Default.UnmergeDefaultReasonCode;

            if (string.IsNullOrEmpty(reasonCode))
            {
                var unmergeComponent = new UnmergeOrderComponent();
                var exitCode         = ApplicationComponent.LaunchAsDialog(
                    this.Context.DesktopWindow,
                    unmergeComponent,
                    string.Format("Undo merge order {0}", AccessionFormat.Format(item.AccessionNumber)));

                if (exitCode != ApplicationComponentExitCode.Accepted)
                {
                    return(false);
                }

                reason = unmergeComponent.SelectedReason;
            }
            else
            {
                // confirm
                var message = string.Format("Un-merge all orders merged into {0}?", item.AccessionNumber);
                if (DialogBoxAction.No == this.Context.DesktopWindow.ShowMessageBox(message, MessageBoxActions.YesNo))
                {
                    return(false);
                }
                reason = new EnumValueInfo(reasonCode, null, null);
            }

            Platform.GetService(
                delegate(IOrderEntryService service)
            {
                var request = new UnmergeOrderRequest(item.OrderRef)
                {
                    UnmergeReason = reason
                };
                service.UnmergeOrder(request);
            });

            InvalidateFolders();
            return(true);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
        public OrderListTable()
            : base(3)
        {
            this.Columns.Add(new DateTableColumn <OrderListItem>(SR.ColumnCreatedOn, order => order.EnteredTime, 0.5f));
            this.Columns.Add(new DateTimeTableColumn <OrderListItem>(SR.ColumnScheduledFor, order => order.OrderScheduledStartTime, 0.75f));
            this.Columns.Add(new TableColumn <OrderListItem, string>(SR.ColumnImagingService, order => order.DiagnosticService.Name, 1.5f));

            this.Columns.Add(new TableColumn <OrderListItem, string>(
                                 SR.ColumnStatus,
                                 order => order.OrderStatus.Code == "SC" && order.OrderScheduledStartTime == null
                                        ? SR.MessageUnscheduled
                                        : order.OrderStatus.Value,
                                 0.5f));

            this.Columns.Add(new TableColumn <OrderListItem, string>(
                                 SR.ColumnMoreInfo,
                                 order => string.Format(SR.FormatMoreInfo,
                                                        AccessionFormat.Format(order.AccessionNumber),
                                                        PersonNameFormat.Format(order.OrderingPractitioner.Name),
                                                        order.OrderingFacility.Name),
                                 1));

            this.Columns.Add(new TableColumn <OrderListItem, string>(SR.ColumnIndication, order => string.Format(SR.FormatIndication, order.ReasonForStudy), 2));
        }
            public MergeOrdersTable()
            {
                ITableColumn accesionNumberColumn;

                this.Columns.Add(accesionNumberColumn = new TableColumn <OrderDetail, string>(SR.ColumnAccessionNumber, o => AccessionFormat.Format(o.AccessionNumber), 0.25f));
                this.Columns.Add(new TableColumn <OrderDetail, string>(SR.ColumnImagingService, o => o.DiagnosticService.Name, 0.75f));

                this.Sort(new TableSortParams(accesionNumberColumn, true));
            }
Exemplo n.º 8
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));
        }
Exemplo n.º 9
0
 /// <summary>
 /// Formats the specified Accession #, which must be an unformatted accession number string.
 /// </summary>
 /// <param name="accessionString"></param>
 /// <returns></returns>
 public string FormatAccessionNumber(string accessionString)
 {
     return(AccessionFormat.Format(accessionString));
 }
        public OrderSummaryTable()
        {
            this.Columns.Add(new DateTimeTableColumn <OrderSummary>("Scheduled Requested For",
                                                                    delegate(OrderSummary order) { return(order.SchedulingRequestTime); }));
            this.Columns.Add(new TableColumn <OrderSummary, string>(SR.ColumnAccessionNumber,
                                                                    delegate(OrderSummary order) { return(AccessionFormat.Format(order.AccessionNumber)); }));
            this.Columns.Add(new TableColumn <OrderSummary, string>(SR.ColumnImagingService,
                                                                    delegate(OrderSummary order) { return(order.DiagnosticServiceName); }));
            this.Columns.Add(new TableColumn <OrderSummary, string>(SR.ColumnPriority,
                                                                    delegate(OrderSummary order) { return(order.OrderPriority.Value); }));
            this.Columns.Add(new TableColumn <OrderSummary, string>(SR.ColumnStatus,
                                                                    delegate(OrderSummary order) { return(order.OrderStatus.Value); }));

            this.Columns.Add(new TableColumn <OrderSummary, string>("Ordered by",
                                                                    delegate(OrderSummary order) { return(PersonNameFormat.Format(order.OrderingPractitioner.Name)); }));

            this.Columns.Add(new TableColumn <OrderSummary, string>("Ordered From",
                                                                    delegate(OrderSummary order) { return(order.OrderingFacility); }));
            this.Columns.Add(new TableColumn <OrderSummary, string>("Reason for Study",
                                                                    delegate(OrderSummary order) { return(order.ReasonForStudy); }));
            this.Columns.Add(new DateTableColumn <OrderSummary>(SR.ColumnCreatedOn,
                                                                delegate(OrderSummary order) { return(order.EnteredTime); }));
        }
Exemplo n.º 11
0
 private static string FormatDescription(TItem item)
 {
     // if there is no accession number, this item represents a patient only, not an order
     return(item.AccessionNumber == null ? null :
            string.Format("{0} {1}", AccessionFormat.Format(item.AccessionNumber), ProcedureFormat.Format(item)));
 }
Exemplo n.º 12
0
        public PriorSummaryTable()
        {
            this.Columns.Add(new TableColumn <PriorProcedureSummary, string>("Accession Number",
                                                                             delegate(PriorProcedureSummary item) { return(AccessionFormat.Format(item.AccessionNumber)); }));
            this.Columns.Add(new TableColumn <PriorProcedureSummary, string>("Procedure",
                                                                             delegate(PriorProcedureSummary item) { return(ProcedureFormat.Format(item)); }));

            this.Columns.Add(new DateTableColumn <PriorProcedureSummary>("Performed Date",
                                                                         delegate(PriorProcedureSummary item) { return(item.PerformedDate.Value); }));
            this.Columns.Add(new TableColumn <PriorProcedureSummary, string>("Report Status",
                                                                             delegate(PriorProcedureSummary item) { return(item.ReportStatus.Value); }));
        }