Procedure

LateTrayOrder

Module

fODDietLT

Last Modified

7/15/2014 3:26:42 PM

Scope

Interfaced

Declaration

procedure LateTrayOrder(LateTrayFields: TLateTrayFields; IsInpatient: boolean);

Calls Hierarchy


LateTrayOrder
 ├OrderLateTray
 │ └SetOrderFromResults
 │   └SetOrderFields
 │     ├TOrder.Clear
 │     ├SeqOfDGroup
 │     │ └LoadDGroupMap
 │     └TopNameOfDGroup
 │       └LoadDGroupMap
 └TChanges.Add
   └TChangeItem.Create

Called-By Hierarchy


                                             LateTrayOrder
                               TfrmODBase.cmdAcceptClick┤ 
                                   ActivateOrderDialog┘ │ 
                           TfrmRemDlg.btnFinishClick┤   │ 
           TfrmConsults.mnuActNewConsultRequestClick┤   │ 
                   TfrmConsults.cmdNewConsultClick┘ │   │ 
                TfrmConsults.mnuActNewProcedureClick┤   │ 
                      TfrmConsults.cmdNewProcClick┘ │   │ 
                                        ChangeOrders┤   │ 
                      TfrmOrders.mnuActChangeClick┤ │   │ 
                        TfrmMeds.mnuActChangeClick┘ │   │ 
                                     ChangeOrdersEvt┤   │ 
                                          CopyOrders┤   │ 
                        TfrmOrders.mnuActCopyClick┤ │   │ 
                          TfrmMeds.mnuActCopyClick┤ │   │ 
                           TfrmODActive.btnOKClick┘ │   │ 
                                      TransferOrders┤   │ 
                        TfrmOrders.mnuActCopyClick┤ │   │ 
                          TfrmMeds.mnuActCopyClick┤ │   │ 
                           TfrmODActive.btnOKClick┘ │   │ 
                            TfrmOrders.lstWriteClick┤   │ 
               TfrmOrders.PlaceOrderForDefaultDialog┤   │ 
                  TfrmOrders.DisplayDefaultDlgList┤ │   │ 
                       TfrmOrders.ResetOrderPage┘ │ │   │ 
               TfrmOrders.btnDelayedOrderClick┘   │ │   │ 
                                 DisplayEvntDialog┤ │   │ 
                             SetDelayEventForMed┘ │ │   │ 
                      TfrmMeds.mnuActCopyClick┘   │ │   │ 
                                 DisplayEvntDialog┤ │   │ 
                                  SetViewForCopy┘ │ │   │ 
                    TfrmOrders.mnuActCopyClick┘   │ │   │ 
                                 DisplayEvntDialog┘ │   │ 
                                ExecuteChangeEvt┘   │   │ 
                 TfrmOrders.mnuActChgEvntClick┘     │   │ 
                             TfrmMeds.mnuActNewClick┤   │ 
                           TfrmOMNavA.ActivateDialog┤   │ 
                         TfrmOMNavA.grdMenuKeyDown┤ │   │ 
                         TfrmOMNavA.grdMenuMouseUp┘ │   │ 
                                TfrmOMSet.DoNextItem┘   │ 
                              TfrmOMSet.InsertList┤     │ 
                               ActivateOrderList┘ │     │ 
                     TfrmRemDlg.btnFinishClick┤   │     │ 
                             ActivateOrderHTML┤   │     │ 
                    TfrmOrders.lstWriteClick┤ │   │     │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┘ │   │     │ 
                              ActivateOrderSet┤   │     │ 
                   TfrmRemDlg.btnFinishClick┤ │   │     │ 
TfrmConsults.mnuActNewConsultRequestClick...┤ │   │     │ 
     TfrmConsults.mnuActNewProcedureClick...┤ │   │     │ 
                    TfrmOrders.lstWriteClick┤ │   │     │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┤ │   │     │ 
                     TfrmMeds.mnuActNewClick┤ │   │     │ 
                TfrmOMNavA.ActivateDialog...┤ │   │     │ 
                     TfrmOMSet.DoNextItem...┘ │   │     │ 
                       TfrmOMNavA.DoSelectList┘   │     │ 
                     TfrmOMNavA.grdMenuKeyUp┤     │     │ 
                   TfrmOMNavA.grdMenuMouseUp┘     │     │ 
                                        SkipToNext┤     │ 
                         TfrmOMSet.DoNextItem...┘ │     │ 
                            TfrmOMSet.UMDelayEvent┘     │ 
                               TfrmODDiet.cmdAcceptClick┘ 
                            TfrmODDiet.nbkDietChanging┘   

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); -
OrderLateTray procedure OrderLateTray(NewOrder: TOrder; Meal: Char; const MealTime: string; Bagged: Boolean); -

Called-By

Name Declaration Comments
TfrmODBase.cmdAcceptClick procedure cmdAcceptClick(Sender: TObject); -
TfrmODDiet.cmdAcceptClick procedure cmdAcceptClick(Sender: TObject); -


Source

222   procedure LateTrayOrder(LateTrayFields: TLateTrayFields; IsInpatient: boolean);
223   const
224     TX_EL_SAVE_ERR    = 'An error occurred while saving this late tray order.';
225     TC_EL_SAVE_ERR    = 'Error Saving Late Tray Order';
226   var
227     NewOrder: TOrder;
228     CanSign: integer;
229   begin
230     NewOrder := TOrder.Create;
231     try
232       with LateTrayFields do OrderLateTray(NewOrder, LateMeal, LateTime, IsBagged);
233       if NewOrder.ID <> '' then
234       begin
235         if IsInpatient then
236           begin
237             if (Encounter.Provider = User.DUZ) and User.CanSignOrders
238               then CanSign := CH_SIGN_YES
239               else CanSign := CH_SIGN_NA;
240           end
241         else
242           begin
243             CanSign := CH_SIGN_NA;
244           end;
245         Changes.Add(CH_ORD, NewOrder.ID, NewOrder.Text, '', CanSign);
246         SendMessage(Application.MainForm.Handle, UM_NEWORDER, ORDER_NEW, Integer(NewOrder))
247       end
248       else InfoBox(TX_EL_SAVE_ERR, TC_EL_SAVE_ERR, MB_OK);
249     finally
250       NewOrder.Free;
251     end;
252   end;