Esempio n. 1
0
        protected void HandleCancelDiscontinueOrder(OBR obr)
        {
            var cancelDiscontinueOperation = new CancelOrDiscontinueOrderOperation();

            cancelDiscontinueOperation.Execute(
                _persistenceManager.GetOrderByPlacer(obr.PlacerOrderNumber.EntityIdentifier.Value, "Unable to update order"),
                new OrderCancelInfo()
                );
        }
Esempio n. 2
0
        public bool CanCancelOrder(WorklistItemKey itemKey)
        {
            if (!Thread.CurrentPrincipal.IsInRole(AuthorityTokens.Workflow.Order.Cancel))
            {
                return(false);
            }

            // the worklist item may represent a patient without an order,
            // in which case there is no order to cancel
            if (itemKey.OrderRef == null)
            {
                return(false);
            }

            var order = this.PersistenceContext.GetBroker <IOrderBroker>().Load(itemKey.OrderRef);

            // cancel or discontinue
            var operation = new CancelOrDiscontinueOrderOperation();

            return(operation.CanExecute(order));
        }
Esempio n. 3
0
        private static void CancelOrderHelper(Order order, OrderCancelInfo info)
        {
            var operation = new CancelOrDiscontinueOrderOperation();

            operation.Execute(order, info);
        }