Procedure

AddSelectedToChanges

Module

uOrders

Last Modified

7/15/2014 3:26:42 PM

Comments

Update Changes with orders that were created by taking actions

Scope

Interfaced

Declaration

procedure AddSelectedToChanges(AList: TList);

Calls Hierarchy


AddSelectedToChanges
 ├TChanges.Add
 │ └TChangeItem.Create
 ├TChanges.ExistForOrder
 └UnlockOrder

Called-By Hierarchy


          AddSelectedToChanges
  TfrmOrders.mnuActHoldClick┤ 
TfrmOrders.mnuActUnholdClick┤ 
 TfrmOrders.mnuActRenewClick┤ 
    TfrmMeds.mnuActHoldClick┤ 
   TfrmMeds.mnuActRenewClick┤ 
  TfrmMeds.mnuActUnholdClick┘ 

Calls

Name Declaration Comments
TChanges.Add procedure Add(ItemType: Integer; const AnID, ItemText, GroupName: string; SignState: Integer; AParentID: string = ''; User: int64 = 0; OrderDG: String = ''; DCOrder: Boolean = False; Delay: Boolean = False; ProblemAdded: Boolean = False); -
TChanges.ExistForOrder function ExistForOrder(const AnID: string): Boolean; -
UnlockOrder procedure UnlockOrder(OrderID: string); -

Called-By

Name Declaration Comments
TfrmOrders.mnuActHoldClick procedure mnuActHoldClick(Sender: TObject); -
TfrmMeds.mnuActHoldClick procedure mnuActHoldClick(Sender: TObject); -
TfrmOrders.mnuActRenewClick procedure mnuActRenewClick(Sender: TObject); -
TfrmMeds.mnuActRenewClick procedure mnuActRenewClick(Sender: TObject); -
TfrmOrders.mnuActUnholdClick procedure mnuActUnholdClick(Sender: TObject); -
TfrmMeds.mnuActUnholdClick procedure mnuActUnholdClick(Sender: TObject); -


Source

431   procedure AddSelectedToChanges(AList: TList);
432   { update Changes with orders that were created by taking actions }
433   var
434     i, CanSign: Integer;
435     AnOrder: TOrder;
436   begin
437     if (Encounter.Provider = User.DUZ) and User.CanSignOrders
438       then CanSign := CH_SIGN_YES
439       else CanSign := CH_SIGN_NA;
440     with AList do for i := 0 to Count - 1 do
441     begin
442       AnOrder := TOrder(Items[i]);
443       with AnOrder do Changes.Add(CH_ORD, ID, Text, '', CanSign);
444       if (Length(AnOrder.ActionOn) > 0)
445         and not Changes.ExistForOrder(Piece(AnOrder.ActionOn, ';', 1))
446         then UnlockOrder(AnOrder.ActionOn);
447     end;
448   end;