Esempio n. 1
0
		private static void CancelOrderHelper(Order order, OrderCancelInfo info)
		{
			var operation = new CancelOrDiscontinueOrderOperation();
			operation.Execute(order, info);
		}
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);
		}