Function

CreateOrderDialog

Module

uOrders

Last Modified

7/15/2014 3:26:42 PM

Scope

Global

Declaration

function CreateOrderDialog(Sender: TComponent; FormID: integer; AnEvent: TOrderDelayEvent; ODEvtID: integer = 0): TfrmODBase;

Calls Hierarchy


CreateOrderDialog
 ├SetOrderEventTypeOnCreate
 ├SetOrderEventIDOnCreate
 ├SetOrderFormIDOnCreate
 ├UseNewMedDialogs
 ├TfrmBase508Form.Create
 │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ ├UnfocusableControlEnter
 │ └AdjustControls
 │   ├TfrmBase508Form.ModifyUnfocusableControl
 │   └..(rec)..
 └DestroyingOrderDialog
   ├ActiveOrdering
   ├ClearOrderRecall
   └UnlockIfAble
     └UnlockPatient

Called-By Hierarchy


                                       CreateOrderDialog
                                   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┘     

Calls

Name Declaration Comments
TfrmBase508Form.Create constructor Create(AOwner: TComponent); override; -
DestroyingOrderDialog procedure DestroyingOrderDialog; -
SetOrderEventIDOnCreate procedure SetOrderEventIDOnCreate(AnEvtID: integer); -
SetOrderEventTypeOnCreate procedure SetOrderEventTypeOnCreate(AType: Char); -
SetOrderFormIDOnCreate procedure SetOrderFormIDOnCreate(AFormID: Integer); -
UseNewMedDialogs function UseNewMedDialogs: Boolean; -

Called-By

Name Declaration Comments
ActivateOrderDialog function ActivateOrderDialog(const AnID: string; AnEvent: TOrderDelayEvent; AnOwner: TComponent; ARefNum: Integer; ANeedVerify: boolean = True): Boolean; -


Source

176   function CreateOrderDialog(Sender: TComponent; FormID: integer; AnEvent: TOrderDelayEvent; ODEvtID: integer = 0): TfrmODBase;
177   { creates an order dialog based on the FormID and returns a pointer to it }
178   type
179     TDialogClass = class of TfrmODBase;
180   var
181     DialogClass: TDialogClass;
182   begin
183     Result := nil;
184     // allows the FormCreate to check event under which dialog is created
185     if AnEvent.EventType in ['A','D','T','M','O'] then
186     begin
187      SetOrderEventTypeOnCreate(AnEvent.EventType);
188      SetOrderEventIDOnCreate(AnEvent.EventIFN);
189     end else
190     begin
191      SetOrderEventTypeOnCreate(#0);
192      SetOrderEventIDOnCreate(0);
193     end;
194     SetOrderFormIDOnCreate(FormID);  
195     // check to see if we should use the new med dialogs
196     if uNewMedDialog = 0 then
197     begin
198       if UseNewMedDialogs then uNewMedDialog := 1 else uNewMedDialog := -1;
199     end;
200     if (uNewMedDialog > 0) and ((FormID = OD_MEDOUTPT) or (FormID = OD_MEDINPT)) then
201         FormID := OD_MEDS;
202     // create the form for a given ordering dialog
203     case FormID of
204     OD_MEDIV:     DialogClass := TfrmODMedIV;
205     OD_MEDINPT:   DialogClass := TfrmODMedIn;
206     OD_MEDS:      DialogClass := TfrmODMeds;
207     OD_MEDOUTPT:  DialogClass := TfrmODMedOut;
208     OD_MEDNONVA:  DialogClass := TfrmODMedNVA;
209     OD_MISC:      DialogClass := TfrmODMisc;
210     OD_GENERIC:
211        begin
212         if ODEvtID>0 then
213          SetOrderEventIDOnCreate(ODEvtID);
214         DialogClass := TfrmODGen;
215        end;
216     OD_IMAGING:   DialogClass := TfrmODRad;
217     OD_DIET:      DialogClass := TfrmODDiet;
218     OD_LAB:       DialogClass := TfrmODLab;
219     OD_BB:        DialogClass := TfrmODBBank;
220     OD_CONSULT:   DialogClass := TfrmODCslt;
221     OD_PROCEDURE: DialogClass := TfrmODProc;
222     OD_TEXTONLY:  DialogClass := TfrmODText;
223     OD_VITALS:    DialogClass := TfrmODVitals;
224     //OD_ALLERGY:   DialogClass := TfrmODAllergy;
225     OD_AUTOACK:   DialogClass := TfrmODAuto;
226     else Exit;
227     end;
228     if Sender = nil then Sender := Application;
229     Result := DialogClass.Create(Sender);
230     if Result <> nil then Result.CallOnExit := DestroyingOrderDialog;
231     SetOrderEventTypeOnCreate(#0);
232     SetOrderEventIDOnCreate(0);
233     SetOrderFormIDOnCreate(0);
234   end;